jQuery 在显示/隐藏之间缓动动画
我有一个使用显示/隐藏来显示各种内容的表单。我想使用某种缓动方法进行过渡。理想情况下,如果显示的新内容比以前的内容或类似内容更大,它就会“变得”更大。
我看过缓动插件,但我不知道如何将其应用于显示/隐藏的转换......我迷路了。
任何帮助都会很棒。
谢谢你!
I have a form that uses show/hide to display various content. I'd like to use some sort of an easing method for the transition. Ideally, it would "grow" bigger if the new content being shown is bigger than the previous or something of the sort.
I've looked at the easing plugin, but I don't see how you can apply it to a transition of show/hide... I'm lost.
Any help would be awesome.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从 jQuery 1.4.3 开始,您可以向 show 函数添加缓动,如下所示
,其中 [easing] 是表示缓动方法的字符串。标准 jquery 有两种缓动类型“swing”和“linear”,但您可以在 jQuery UI 中找到更多类型。
更多信息请参见文档
since jQuery 1.4.3 you can add easing to the show function like so
where [easing] is a string that represents an easing method. With standard jquery there are two easing types 'swing' and 'linear' but you can find more in jQuery UI.
more info in the documentation