jQuery的.slideToggle()水平替代? [英] jquery .slideToggle() horizontal alternative?

查看:147
本文介绍了jQuery的.slideToggle()水平替代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我现在有一个水平隐藏/显示和点击动画,但我希望我的幻灯片是水平的。有切换选项。因此,当我点击活动链接时,它将播放动画并将其隐藏起来。



最好的方法是什么?

解决方案 $ b

  $('#element')。animate({width:'toggle'}); 

http:// jsfiddle.net/7ZBQa/


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'});

http://jsfiddle.net/7ZBQa/

这篇关于jQuery的.slideToggle()水平替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆