STYLE SWITCHER

How change class with an automatic time

jquery_black

[js]
$(document).ready(function(){

$(".slider li:first-child").addClass("active");

setTimeout(autoAddClass, 1000);

});

function autoAddClass(){

var next = $(".active").removeClass("active").next();

if(next.length)

$(next).addClass(‘active’);

else

$(‘.slider li:first-child’).addClass(‘active’);

setTimeout(autoAddClass, 1000);

}
[/js]

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *