Some time you added slider on website home page at top position and find whenever you load website slider all images show and page looks bad.

I have spend much time to find solution, slider images show one image on load but nothing found so, I have made temporary solution for that which I am sharing with you.

First, I have made slider main class (bannerslider) with display none by css. Now add jQuery “set time” and “clear time” interval for display blocks that mail class. It’s working fine for me.

Please have a look of below jQuery script code:

var jQuery = jQuery.noConflict(); 
var myVar; 
jQuery(document).ready(function(){ 
jQuery('.bxslider').bxSlider({ 
auto: true 
}); 
jQuery(".bannerslider").css("display","none"); 
if(jQuery(".bannerslider").css("display") =="none"){ 
myFunction(); 
}else{ 
myStopFunction(); 
} 
}); 
//myFunction(); 
function myFunction() { 
myVar = setTimeout(function(){ jQuery(".bannerslider").css("display","block"); }, 300); 
} 
function myStopFunction() { 
clearTimeout(myVar); 
}
Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.