WP Sequence Viewer Plugin

Last time I was developing my sequence viewer plugin for wordpress I was having some trouble loading the player. I was using the JQuery .load() function to start the player as soon as the images where loaded. But the .load() function did not fire every time. Sometimes I had to refresh the page 2 times before it would fire.
I was searching around and I found this peace of code which worked for me. And it works in all browsers!
1 2 3 4 5 6 7 8 9 10 11 12 13
$("#Img").one("load",function(){
//image is loaded
})
.each(function(){
if(this.complete || (jQuery.browser.msie && parseInt(jQuery.browser.version) == 6))
$(this).trigger("load");
});