Outils pour utilisateurs

Outils du site


Panneau latéral

webdev:javascript:snippets:simple_slideshow

Simple slideshow

jQuery(document).ready(function(){
    var speed = 700;
    jQuery('div.main-history-image div.main-history-container img').first().addClass('image-current');
    
    function changeImage (target)
    {
        target.fadeIn(0);
        jQuery('.image-current').fadeOut(speed, 'linear', function()
        {
            jQuery('.image-current').removeClass('image-current');
            target.addClass('image-current');
        });
    }
    
    var timer = setInterval(function()
    {    
        if( jQuery('.image-current').next()[0] != null )
        {
            changeImage( jQuery('.image-current').next() );
        } else {
            changeImage( jQuery('div.main-history-image div.main-history-container img').first() );
        }
    },8000);
});
webdev/javascript/snippets/simple_slideshow.txt · Dernière modification: 05/11/2018 17:30 de dolo