Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

change the background of an element in a loop using css

    var colors = ['blue', 'green', 'yellow', 'black'],
        colorIndex = 0,
        $body = $('body');
    
    setInterval(function(){ $body.css('background', colors[colorIndex++ % colors.length])}, 1000);
Source by jsfiddle.net #
 
PREVIOUS NEXT
Tagged: #change #background #element #loop #css
ADD COMMENT
Topic
Name
1+1 =