The scriptaculous wiki has a demo () that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing.
How do I achieve this?
Thanks.
The scriptaculous wiki has a demo (http://github./madrobby/scriptaculous/wikis/effect-slidedown) that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing.
How do I achieve this?
Thanks.
Share Improve this question asked Oct 29, 2008 at 18:16 GezimGezim 7,32811 gold badges68 silver badges106 bronze badges2 Answers
Reset to default 8Use Effect.toggle.
Effect.toggle('element_id', 'slide');
Wrap it in a function, call the function instead.
function slideMe(myDiv) {
if(Element.visible(myDiv)) {
//slide up
}
else {
//slide down
}
}