PDA

View Full Version : Updating Open Menu from External link - Cookie?



codism
07-15-2009, 11:47 AM
1) Script Title:
Accordion Menu script (v1.7.1)

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm

3) Describe problem:

I've got the menu working correctly and everything is great.
However, I also have other links which are outside the accordion menu which go to the same pages within.

I'm using persistent menu's so when I jump into these pages from these link outside the accordion, the previous menu selected when last used the accordion is open.

I'm assuming I need to somehow update the cookie with the new location on the link... but no entirely sure how to do this.

Any help would be great.

Many thanks

ddadmin
07-16-2009, 05:09 AM
Hmm not sure I fully understand what you're asking actually. If you're asking how to have a particular accordion menu header expanded based on the referring page's URL, you can use the "URL parameter feature (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm)" (bottom of page) of the script (by adding ?headerclass=whatever) to the referring page's URL if you have access to the referring page. If not, you may be able to use the oninit() event handler (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment2.htm) of the script, along with JavaScript's document.referrer property, to try and detect the referring page's URL, and expand a header accordingly.

codism
07-16-2009, 07:38 AM
Great stuff!
Thanks a lot.

I put the URL parameter on the external links and it worked all perfectly.

Thanks again :)