I'm trying to make my DIV
background loop between 3 images. I have a DIV
and 3 classes, each specifying unique backgrounds.
On page load, I need javascript to append .class1
to the DIV
, then half a second later, remove class1 and add .class2
; again half a second later, remove class2 and add .class3
; finally, remove class3 and go back to the first class and start again.
HTML:
<div id="rabbit"></div>
CSS:
.rabbit1 {background: url(http://i.imgur.com/fd3fo.jpg);}
.rabbit2 {background: url(http://i.imgur.com/SHknQ.jpg);}
.rabbit3 {background: url(http://i.imgur.com/Utel1.jpg);}
Here is the jsfiddle: http://jsfiddle.net/XDUSA/
I'm sorry, I'm new to this and I don't know where to start. Thank you for your help in advance.