jquery run function after element is loaded code example
Example 1: call a function on load jquery
$(document).ready(function () {
// Function code here.
});
Example 2: call javascript function after div load
document.querySelector('img.my-image').addEventListener('load', function(){
// The image is ready!
});