jQuery平滑动画

编程入门 行业动态 更新时间:2024-10-27 09:43:35
本文介绍了jQuery平滑动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有这个动画,使屏幕上的节拍"按钮变了.效果很好,这是一件事,动画太锐利"而不平滑,我该如何平滑呢?

I have this animation that makes some buttons on screen 'beat'. It works fine exept one thing, the animation is too 'sharp' and not smooth, how can I smooth it?

function myFunction() { setInterval(function () { tstFnc(); }, 1000); } var flag = true; function tstFnc() { var numM = Math.floor((Math.random() * 10) + 1); var stringM = '#mgf_main' + numM + ' img'; $(stringM).animate({ width: '80px', height: '80px' }, 150, function () { $(stringM).animate({ width: '68px', height: '68px' }, 150, function () { // nothing }); }); };

推荐答案

您可以在动画选项上设置easing属性.

You can set the easing property on the animate options.

api.jquery/animate/

easings/

更多推荐

jQuery平滑动画

本文发布于:2023-11-27 20:50:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639555.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平滑   动画   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!