How do I animate though a PNG sequence using jQuery (either by scrolling or triggered animation) [closed]

老子叫甜甜 提交于 2019-12-03 01:47:55

you just want to swap out the src attribute using a setInterval timer

var myAnim = setInterval(function(){
  $(".myImageHolder").attr('src', nextImage);
}, 42);

The trick is how you generate nextImage. This largely depends on the naming conventions of your images, or which direction you wish the animation to run in

Update

Or use a plugin

Zugbo

Perhaps instead of switching between different images, use the spriting technique described in this question: How to show animated image from PNG image using javascript? [ like gmail ]

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!