PDA

View Full Version : Cookie for Animated Collapsible DIV v2.4



isleoflife
08-21-2009, 08:22 AM
Hi Guys,

I use the script "Animated Collapsible DIV v2.4" as Slide-Menu. Everytime I go to an other Side on my page, the Slide-Menu is closing.
Is it possible to set an Cookie, so the Slide-Menu will always stay open.

I am really happy if someone helps me!

Thanks and best Regards

isleoflife

isleoflife
08-21-2009, 08:23 AM
Sorry for my bad english. I hope you understand?

davelf
08-21-2009, 09:04 AM
this some cookie script, may be you can add this at your js file,


var setName={
getCookie:function(Name){
var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
}

setCookie:function(name, value){
document.cookie = name+"="+value
},


init:function(config){
$(document).ready(function(){
var selected=(config.persiststate)? featuredcontentglider.getCookie(config.gliderid) : config.selected
config.selected=(isNaN(parseInt(selected))) ? config.selected : selected //test for cookie value containing null (1st page load) or "undefined" string
})

}


i get this script from the contentGliderScript(created by dynamicdrive)
good luck..:)