views:

28

answers:

2

Hi, I am using looped slider js for implementing a slider in wordpress. Basically i want to add my slider when entire page loads. please help me. I tried lazyload plugin for that but wont get any success. My markup is like this,

<div class="container">
<div class="slides" >
<div><a><img /></a><a><img /></a></div>
</div>
</div>

Thanks

+1  A: 

You can use Javascript to delay the divisions load time by a few seconds, allowing everything else to load before it. Something like this would do I think.

function changeDivContent() {
    var slider = document.getElementById('slides'); 
    var content = "Insert code here to change after delay";     
    slides.innerHTML = content;
}

function init() {
    setTimeout('changeDivContent()', 5000);
}

window.onload = init;
Liam Spencer
+2  A: 
$(document).ready(function(){ ... });

fires on page load (HTML is downloaded)

$(window).load(function(){ ... });

fires when page is ready (images are loaded, etc)

Greg