jquery 动画效果有问题
- Press any of buttons. Can you see shaky slideDown effect? In fact it must be smooth and slow slide down.
- If you've pressed for 1 time any of buttons try to press another one. The show and hide animation of forms is awful.
During anim.
After anim.
How to fix this problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当选项卡中的每个元素隐藏或显示时,似乎会发生抖动。
获取每个选项卡的高度,并将调整大小动画实现到这些高度,而不是在每个元素隐藏或显示后单独设置动画。
The shakiness seems to be happening when each of the elements in the tab is hidden or displayed.
Get the height of each of your tabs and implement your resizing animation to those heights rather than individually animating after each element is hidden or displayed.
尝试使用
.animate()
和.fadeIn()
.fadeOut()
.fadeTo(time,opacity)
code> 而不仅仅是.show()
或.hide()
Try to play with
.animate()
and.fadeIn()
.fadeOut()
.fadeTo(time,opacity)
instead of just.show()
or.hide()
对我来说加载得很好。然而,它首先加载确实花了很长时间。如果您访问:http://gtmetrix.com/reports/tural.no- ip.org/ANBNA45n 您会发现您的页面加载速度非常缓慢,并且您看到的卡顿效果可能是由于您的计算机出现了传入信息量的问题。
It's loading quite well for me. However it did take a long time for it to load in the first place. If you go to: http://gtmetrix.com/reports/tural.no-ip.org/ANBNA45n You'll see that your page is loading quite slowly and the stuttering effect you are seeing is probably coming from your computer having issues with the amount of information coming in.
您可以尝试通过减少 $(selector) 调用来加快速度..当您多次使用它们时缓存一些 jQuery 对象...还记得您可以在 jQuery 对象上链接函数..
jQO .addClass("foo").removeClass("bar");
与jQO.addClass("foo"); 相同jQO.removeClass("bar");
就像这样......
You can try and speed things up a bit by making less $(selector) calls.. cache some of your jQuery objects when you are using them multiple times... also remember you can chain functions on jQuery objects..
jQO.addClass("foo").removeClass("bar");
is the same asjQO.addClass("foo"); jQO.removeClass("bar");
like so...