Hm, yeah I read some of the documentation and it looks like it can be pretty buggy. I've only ever used .load() on document to wait for everything to load, so it may not work very well on elements after all. xP
The philosophy of the ready() event in jQuery is based on the DomReady event of Vanilla Javascript, that is usually thrown by the window object. For other objects, like images, or divs, use the load() event.
.ready()is usually just called on document, because it tells you when the DOM is finished loading. I think what you're looking for is:Here's a link to the API info: http://api.jquery.com/load-event/
Would this not work:
.ready()would be better majority of the time.I thought that's exactly why we have this amazing plugin: https://github.com/desandro/imagesloaded
.load()on document to wait for everything to load, so it may not work very well on elements after all. xP.ready()method on the document would suggest all elements within the DOM are ready to be used so using the following is sufficient.Why won't the .load event work? But the Hover Does?
This Code Works:
This Code Doesn't Work:
Is there a reason why you want to add a .ready to a div?
See my previous post about using the imagesLoaded plugin.