This question has been asked a couple times but not answered in such a way that it can help me with my specific issue. From a nav list, on click of an item, I\'m loading som
In order to check whether image loaded or not you can use following;
<img src="your_image_path" />
<script>
$('img').load(function() {
//call_your_function();
});
</script>
$('#divId').html(someText).promise().done(function(){
//your callback logic / code here
});
$(window).load(function() {
// code here
})();
Based on Mike Robinson's (and dystroy's) suggestion the answer to my question is:
$("#myContentDiv").html('HTML content comes here');
var contentImages = $("#myContentDiv img");
var totalImages = contentImages.length;
var loadedImages = 0;
contentImages.each(function(){
$(this).on('load', function(){
loadedImages++;
if(loadedImages == totalImages)
{
$("#myContentDiv").tinyscrollbar();
}
});
});