jQuery 在显示/隐藏之间缓动动画

发布于 2024-11-27 01:36:08 字数 161 浏览 6 评论 0原文

我有一个使用显示/隐藏来显示各种内容的表单。我想使用某种缓动方法进行过渡。理想情况下,如果显示的新内容比以前的内容或类似内容更大,它就会“变得”更大。

我看过缓动插件,但我不知道如何将其应用于显示/隐藏的转换......我迷路了。

任何帮助都会很棒。

谢谢你!

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

避讳 2024-12-04 01:36:08

从 jQuery 1.4.3 开始,您可以向 show 函数添加缓动,如下所示

.show( [duration,] [easing,] [callback] )

,其中 [easing] 是表示缓动方法的字符串。标准 jquery 有两种缓动类型“swing”和“linear”,但您可以在 jQuery UI 中找到更多类型。

更多信息请参见文档

since jQuery 1.4.3 you can add easing to the show function like so

.show( [duration,] [easing,] [callback] )

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文