-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
  • 169,008
  • 28
  • 173
  • 236
GibboK
  • 71,848
  • 143
  • 435
  • 658

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
  • 66,513
  • 17
  • 101
  • 130