jQuery的.slideToggle()水平替代? [英] jquery .slideToggle() horizontal alternative?
本文介绍了jQuery的.slideToggle()水平替代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我现在有一个水平隐藏/显示和点击动画,但我希望我的幻灯片是水平的。有切换选项。因此,当我点击活动链接时,它将播放动画并将其隐藏起来。
最好的方法是什么?
解决方案 $ b
$('#element')。animate({width:'toggle'});
slideToggle does exactly what I want, only I want the slide to be horizontal.
I now have an horizontalhide/show and animation on click, but I would like to have the toggle options. So that when I click on the active link, it will play the animation reversed and hide itself.
What would be the best way to do this?
解决方案
You can use the animate
method:
$('#element').animate({width: 'toggle'});
这篇关于jQuery的.slideToggle()水平替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文