Created
February 6, 2017 09:18
-
-
Save sokoljr/ffed8559ca986bbff9fc97f80d16e8d6 to your computer and use it in GitHub Desktop.
Slider full bg image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*BG slider*/ | |
var bgImgSlide = [ | |
'images/gm_slot_bg.jpg', | |
'images/gms_deluxe_bg.jpg', | |
'images/million_bg.jpg', | |
'images/vulkan_bg.jpg' | |
], i=1; | |
function slideBg(){ | |
if(i > (bgImgSlide.length-1)){ | |
$('.slide_bg').animate({'opacity':'0'},400,function(){ | |
i=1; | |
$('.slide_bg').css({'background':'url('+bgImgSlide[0]+')','background-size':'cover', 'background-position':'center'}); | |
}); | |
$('.slide_bg').animate({'opacity':'1'},400); | |
}else{ | |
$('.slide_bg').animate({'opacity':'0'},400,function(){ | |
$('.slide_bg').css({'background':'url('+bgImgSlide[i]+')', 'background-size':'cover', 'background-position':'center'}); | |
i++; | |
}); | |
$('.slide_bg').animate({'opacity':'1'},400); | |
} | |
} | |
var intervalslideBg = setInterval(slideBg,6000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment