I'm trying to hide an image until it fully loads.
I've this jquery
.
//Load image on click
$(document).on("click", '[data-item="zoomIn"]', function(){
var url = $(this).parent().siblings('.largeImgUrl').val();
$('.flickr-big-image').empty().append("<img class='hidden' id='zoomIn' src='"+url+"' >");
$("#flickr-popup").modal('show');
});
//Show image
$('#zoomIn').on('load', function(){
$('#zoomIn').removeClass('hidden');
});
But it seems the onload
event is not functioning. Am I doing it wrong here?