I have a page with a lot of ads being loaded in piece by piece.
I need to position an element relative to overall page height, which is changing during load, because of ads being added.
Question: Is there a jquery event or similar to detect, when all elements are loaded? I'm currently "waiting" with setTimeout, but this is far from nice.
An idle event would be nice, which fires once after pageload if no new http requests are made for xyz secs.
You can use onload
event which triggers when ALL elements eg DOM, images, frames and external resources have loaded into the page.
Vanilla JavaScript:
window.onload = function(){ ......... }
jQuery:
$(window).load(function() {.........});
window.onload
: https://developer.mozilla.org/en/DOM/window.onload$(window).load
: http://api.jquery.com/load-event/If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With