Question

Does anyone know how to add an autoplay function to a plugin that doesn't seem to have the option? The one I am attempting you use autoplay on is called windy: http://tympanus.net/Development/Windy/index.html

Était-ce utile?

La solution

<script type="text/javascript"> 
    $(function() {
        var $el = $( '#wi-el' ), windy = $el.windy();

        var curSlide = 0;
        setInterval(function(){
            if(curSlide == windy.getItemsCount() - 1){
                windy.navigate(0);
            } else{
                windy.next();
            }
            curSlide++;
        }, 2000 );
    });
</script>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top