PDA

View Full Version : Resolved Drop Down Panel Closes After TimeoutPeriod



grayson
06-26-2009, 03:25 PM
1) Script Title: DD Drop Down Panel

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

3) Describe problem: I edited the js file so the panel is open upon entering a page. I am not sure how to code the panel to close after X seconds and would like it to only appear open once per browser session. Is this possible? Thank you in advance!! - Grayson

ddadmin
06-26-2009, 05:50 PM
The code:


panelinstance.togglepanel('up')

can be called to dynamically close a panel (where "panelinstance" is the name of the variable used when initializing it). Having said that, you can do something like the following to close a panel after x seconds:


setTimeout(function(){
panelinstance.togglepanel('up')
}, 5000)

where 5000 is in milliseconds here.

grayson
06-26-2009, 06:26 PM
Thank you for your quick reply!!!

jonboy
12-02-2011, 04:29 AM
This is a great little feature to have, but I can't seem to get it work the way I'm after.

Is there a method to have the initial state as down, and when the user toggles up (no timeout limit) then it won't appear again until they toggle down. Can I do this with with cookies?

I've tried changing the function ddpanel(setting){ setting.dir="up" to down, then toggle close, but when I refresh the page, it always shows in the down state.

Cheers