Help me read this Javascript and pass the right parameters?
February 20, 2006 1:26 PM Subscribe
I'm trying to implement some AJAX features in a project, and need help deciphering the possible options and parameters of the Rico framework's accordion display.
Specifically, I want to use it as a left-side site menu, ala Outlook. But to be useful, I think it needs to remember its open state as the user moves from page to page -- rather than resetting to a default state each time.
The Rico JavaScript file has an accordion section which mentions parameters like lastExpandedTab and onLoadShowTab, but I'm not JS-savvy enough to figure out how to achieve what I'm after.
Specifically, I want to use it as a left-side site menu, ala Outlook. But to be useful, I think it needs to remember its open state as the user moves from page to page -- rather than resetting to a default state each time.
The Rico JavaScript file has an accordion section which mentions parameters like lastExpandedTab and onLoadShowTab, but I'm not JS-savvy enough to figure out how to achieve what I'm after.
Response by poster: You're right, I was lumping the accordion menu under 'AJAX' inappropriately.
I'd consider refreshing page content w/AJAX, except that this is for a site with all the other architecture in place. Individual page URLs were deemed important for SEO. So I'm really just trying to add a menu to the project.
I found that altering onLoadShowTab in the .js file from 0 to x does change the open tab behavior, but passing {onLoadShowTab:2} as a parameter from the page doesn't seem to do it.
posted by Tubes at 2:38 PM on February 20, 2006
I'd consider refreshing page content w/AJAX, except that this is for a site with all the other architecture in place. Individual page URLs were deemed important for SEO. So I'm really just trying to add a menu to the project.
I found that altering onLoadShowTab in the .js file from 0 to x does change the open tab behavior, but passing {onLoadShowTab:2} as a parameter from the page doesn't seem to do it.
posted by Tubes at 2:38 PM on February 20, 2006
It seems like your technique should work. Is it giving you an error? (You can check by loading the page in firefox and going to tools->javascript console)
posted by null terminated at 4:31 PM on February 20, 2006
posted by null terminated at 4:31 PM on February 20, 2006
Response by poster: Hmm. The console shows the same vague error in the css file whether my added {onLoadShowTab:2} parameter is in the page script or not:
posted by Tubes at 9:05 AM on February 21, 2006
Error: Selector expected. Ruleset ignored due to bad selector.
posted by Tubes at 9:05 AM on February 21, 2006
This thread is closed to new comments.
If an "Outlook" look is what you're going for, why are you having users move from page to page at all? Why not simply refresh the content part of the page using AJAX and not modify the left hand Outlook-style accordion section?. This would make the menu not reset automatically, with no work on your part.
Also, it doesn't look like lastExpandedTab is an option. I believe it's used internally by Rico to determine how to animate the div transformations.
posted by null terminated at 1:40 PM on February 20, 2006