Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var galleryImage = $('.gallery').find('img').first();
- var images = [
- "images/laptop-mobile_small.jpg",
- "images/laptop-on-table_small.jpg",
- "images/people-office-group-team_small.jpg"
- ];
- var i =0;
- setInterval(function(){
- i = (i+1) % images.length; //0,1,2,0,1,2 ifinitely
- galleryImage.delay(2000).fadeOut(function(){
- $(galleryImage).attr('src', images[i]);
- $(galleryImage).fadeIn();
- console.log(galleryImage.attr('src'));
- });
- }, 2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement