Reputation: 2950
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
Upvotes: 0
Views: 1815
Reputation: 7922
$(document).ready(function(){ ... });
fires on page load (HTML is downloaded)
$(window).load(function(){ ... });
fires when page is ready (images are loaded, etc)
Upvotes: 2
Reputation: 936
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;
Upvotes: 0