this is not specifically behaviour related, but i thought i would risk
asking anyway.
i am working on a script that triggers a blind down or blind up effect
by clicking on a particular link. it then remembers the status of that
choice by setting a cookie.
the technique was taken from here:
http://www.exit404.com/2005/57/unobt...culous-effects
here is my rule
'a.tools' : function(el){
el.onclick = function(){
if (Element.hasClassName('tool-box', 'invisible')) {
new Effect.BlindDown('tool-box');
Element.removeClassName('tool-box', 'invisible');
setCookie(this.parentNode.id, '', 365);
} else {
new Effect.BlindUp('tool-box');
Element.addClassName('tool-box', 'invisible');
setCookie(this.parentNode.id, 'invisible', 365);
}
}
}
the problem is this line
setCookie(this.parentNode.id, '', 365);
that was taken directly from the artilcle but does not apply to my
situation. in the article he is applying the effects to the same
element that is clicked on, so 'this' is used in the function, where as
i am using 'tool-box', which is the id of the div that is getting
triggered.
so when i get the setCookie part, i need to rewrite it so that it
associates itself with the div 'tool-box instead of 'this'. basically i
just do not know the proper syntax. i tried...
setCookie('tool-box', 'invisible', 365);
but that did not seem to work for me.
any thoughts?
p.s. i did not include the cookie stuff because i do not think it is
needed, but if you think it would be helpful, i can included or you can
find it in the article.