Advertisement
britodfbr

Efeito_fade_troca_imagens_jQuery.js

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