javascript - check image has been loaded using jquery -


problem- @ run time changing/replacing src attribute of images using jquery. these images default hidden. want display these images when these images download , ready display because possible images can not downloaded.

         <img id="pic_1" width="153" height="160" border="0"                  onmouseout="this.style.border='2px solid #ffffff';"                    onmouseover="this.style.border='2px solid #4585e7';"                                         style="visibility: hidden;"                                          src="**to replaced @ run time**""> 

please let me know solution how can achieve this.

i believe can use load event this.

something like:

$('#myimage').load(function() {   //called when image loaded }); 

here working example

here example delayed loading


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -