Making a Jquery shuffle Gallery

后端 未结 1 1631
闹比i
闹比i 2021-01-22 18:22

I\'m trying to do a shuffle slideshow, like this this site. It\'s a gallery with shuffle and fade but I have only this code:

相关标签:
1条回答
  • 2021-01-22 18:37

    Did you mean this (Using jQuery)

    $(function(){
        (function(){
            var imgs=$('.slideshow img');
            var i=0;
            function shuffle()
            {
                $(imgs[i]).fadeIn(2000, function(){
                    i=(i < imgs.length-1) ? (i+1) : 0;
                    setTimeout(function(){
                        $('.slideshow img').fadeOut(2000);
                        shuffle();
                    }, 2000);
                });
            }
            shuffle();
        })();
    });​
    

    DEMO.

    Update: May be you want a random ordered image animation like this one.

    0 讨论(0)
提交回复
热议问题