Greetings and thank you for sparing a moment.
I'm curious to know if there exists a method through jQuery to execute a function immediately after a background image in a div has completed downloading and rendering.
Imagine you have the following div element:
<div id="img1" class="img1"> </div>
with the img1 class styled as follows:
.img1 {
background-image: some_big_image.png;
background-position:center;
background-repeat:no-repeat;
background-size:cover;
display: none;
}
taking into account this JavaScript function:
function showDiv() {
$("#img1").fadeIn(1000);
}
Is it possible to invoke the above function right after the image has been rendered? By rendering, I mean resized to fit neatly within its div and ready to be displayed.
I've come across plenty of information on triggering functions after page loading or image downloading but nothing related to post-rendering.
Your assistance is greatly appreciated. Thank you in advance.