更改jQuery的显示()/隐藏()动画? [英] Change the jquery show()/hide() animation?

查看:112
本文介绍了更改jQuery的显示()/隐藏()动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在默认情况下,如果你指定一个jQuery的速度增加了一个怪异的动画它从左端角落扩展。我希望它只是滑下。有没有办法做到这一点,而不用导入别的东西像jQuery UI?

By default if you specify a speed jquery adds a weird looking animation where it expands from the left end corner. I want it to just slide down. Is there a way to do that without importing something else like jquery UI ?

我在寻找的东西线:

$("test").show('slow', {animation:'slide'})

如果没有办法,那会是什么做到这一点最轻的解决方案?

If there's no way, then what would be the lightest solution to do this?

感谢

推荐答案

有在了slideDown,效果基本show和功能的slideToggle原产于jQuery的1.3+,和他们的工作相当不错...

There are the slideDown, slideUp, and slideToggle functions native to jquery 1.3+, and they work quite nicely...

http://docs.jquery.com/Effects

您可以使用了slideDown就像这样:

You can use slideDown just like this:

$("test").slideDown("slow");

如果你要合并效果和真的想怎么样我想看看动画的功能,它允许你指定一些CSS属性来塑造吐温或变身成。 pretty花哨的东西,这一点。

And if you want to combine effects and really go nuts I'd take a look at the animate function which allows you to specify a number of CSS properties to shape tween or morph into. Pretty fancy stuff, that.

这篇关于更改jQuery的显示()/隐藏()动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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