-1

I need to call a method after an image has been loaded and fully rendered in the browser.

Quick example for a big image:

http://jsfiddle.net/2cLm4epv/

<img width="500px" src="http://www.digivill.net/~binary/wall-covering/(huge!)14850x8000%2520earth.jpg">

My method should be called when the picture is fully visible.

mplungjan
  • 134,906
  • 25
  • 152
  • 209
GibboK
  • 64,078
  • 128
  • 380
  • 620

1 Answers1

2

As we discussed in the comments use the .load() function along with its call back to accomplish your task,

HTML

<img id="bigimage" width="500px" src="http://www.digivill.net/~binary/wall-covering/(huge!)14850x8000%2520earth.jpg"/>

JS

$('#bigimage').load(function(){
    alert('loaded and redered');
});

DEMO

Rajaprabhu Aravindasamy
  • 63,064
  • 13
  • 90
  • 119