You don't really need to modify the script much, you may use the method outlined here to get the header links to open their respective pages:
http://www.dynamicdrive.com/forums/s...55&postcount=9
To get the menu on the 'receiving' page to open, you may use:
Code:
persiststate: true,
in the ddaccordion.init function, but I believe that will be a little unreliable in some cases. What I would suggest is, to be sure - go ahead and use an include, but use separate ddaccordion.init functions for each page. Set:
Code:
persiststate: false,
except on the home page (unless you want default expanded on it too). Set each 'receiving' page's, ex:
Code:
defaultexpanded: [0],
to the menu you want expanded on it, using the number of the header to expand (numbers start at 0 for the first one). Set all page's:
Code:
collapseprev: true,
Finally, if relying on persistence to get the home page to display the last 'receiving' page's menu expanded, make this one small modification to the ddaccordion.js file (comment out (red) the two highlighted lines as shown near the end of that file):
Code:
$('.'+config["contentclass"]+":visible").each(function(index){ //get indices of expanded headers
expandedindices.push($(this).attr('contentindex'))
})
// if (config.persiststate==true){ //persist state?
expandedindices=(expandedindices.length==0)? '-1c' : expandedindices //No contents expanded, indicate that with dummy '-1c' value?
ddaccordion.setCookie(config.headerclass, expandedindices)
// }
})
})
}
}
Bookmarks