Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var images = ['image-1.jpg','image-2.jpg','image-3.jpg','image-4.jpg','image-5.jpg','image-6.jpg'],
- index = 0,
- maxImages = images.length - 1;
- var timer = setInterval(function() {
- var curImage = images[index];
- index = (index == maxImages) ? 0 : ++index;
- $('.header').css({
- 'background-image': 'url('+curImage+')',
- 'transition': 'background 500ms ease'
- });
- }, 1500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement