So I have a small jQuery script that resizes elements according to their background image's aspect ratio. In certain instances, it doesn't work in time, and I believe this is because the code runs before the images finish downloading.
Basically, I have <div>
elements that will have a certain sized background image, and I want the element to be the exact same size. If there is a better way than with JS, I'm all ears.
I can manually set a delay, but is there a way to ONLY run the code after the images finish downloading?
I currently have it in $(document).ready(function(){...});
inside my footer.