PDA

View Full Version : Switch Content Script set cookie expiration?



stuckagain
06-22-2011, 11:55 PM
1) Script Title: Switch Content Script

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

3) Describe problem:
when setting the persist state to true a cookie is written to remember which tab was left open. when starting a new session this cookie will then attempt to reopen the tab. instead it closes the tab showing nothing. similar to double clicking a tab toggling it. is there a way to set the cookie to be a session cookie so that a default tab's content will show rather than nothing?

thanks

stuckagain

stuckagain
06-23-2011, 04:17 PM
another idea would be to check if the tab is already active and have the script do nothing rather than collapsing the div.

Any help here?

thanks

stuckagain

ddadmin
06-23-2011, 11:49 PM
Actually the script does support both "session only" and persistent cookies; in the former case, starting a new browser session will reset things and cause just the default expanded content to be expanded when the page first loads. Inside your initialization code, the following line determines which persistence option to use:


bobexample.setPersist(true) //session only

versus:


bobexample.setPersist(true, 7) //persistent cookie for 7 days

stuckagain
06-24-2011, 03:04 AM
confirmed once again - im slow :confused:

thanks for pointing that out!

stuckagain