[英]making a link toggle between SlideDown and SlideUp (scriptaculous)
The scriptaculous wiki has a demo ( http://github.com/madrobby/scriptaculous/wikis/effect-slidedown ) that shows the SlideDown effect in use. scriptaculous wiki有一个演示( http://github.com/madrobby/scriptaculous/wikis/effect-slidedown ),显示正在使用的SlideDown效果。 However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing. 但是,如果隐藏了某个DIV,我需要使用相同的链接向下滑动,如果显示DIV,则需要使用SlideUp。
How do I achieve this? 我该如何实现这一目标?
Thanks. 谢谢。
使用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
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.