-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
  • 155,085
  • 27
  • 166
  • 222
GibboK
  • 68,054
  • 134
  • 405
  • 638

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
  • 64,912
  • 15
  • 96
  • 124