开发者

Javascript/jQuery Animation

开发者 https://www.devze.com 2023-04-12 07:45 出处:网络
I am slowly moving away from Flash 开发者_JAVA技巧and into HTML/JS as a substitute. I am trying to achieve the slideshow effect as seen in the link below. In Actionscript this would be done using the

I am slowly moving away from Flash 开发者_JAVA技巧and into HTML/JS as a substitute. I am trying to achieve the slideshow effect as seen in the link below. In Actionscript this would be done using the Tween function.

http://www.mrporter.com/

Is there anything similar and efficient (i.e. not processor intensive) available for javascript jQuery that can allow for this....? Any recommended 3rd party packaged, API's etc...

Many Thanks


jQuery animate is a great start to do animations.

Put all your images into a <div> next to eachother, and animate every 1000 ms. to the next animation.

var numberOfImages = 5, ix = 0;
setInterval(function () {
    // reset after 'numberOfImages' is reached
    ix = ++ix = numberOfImages ? 0 : ix; 

    $('#awesomeImage').animate({
        left: ix * -500px
    }, { "duration": "slow", "easing": "easein" });
}, 1000);
0

精彩评论

暂无评论...
验证码 换一张
取 消