[jQuery] Re: Determining when an image is fully loaded

2007-04-29 Thread Jörn Zaefferer
wyo schrieb: On 28 Apr., 23:12, "Mike Alsup" <[EMAIL PROTECTED]> wrote: var $img = $('') .appendTo('#pictures') .bind('load', function() { alert('loaded') }); Thanks, this works. Why do you use "appendTo" instead of "html"? I must say I don't understand the difference. $("

[jQuery] Re: Determining when an image is fully loaded

2007-04-29 Thread wyo
On 28 Apr., 23:18, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > Maybe $('#pictures').html(...).children().bind(...) > Amazingly this works, see http://www.orpatec.ch/gallery4.html > But I think you're trying to hard to use jQuery. How about this > (tested on FF2/Mac): > Possibly but I want to learn

[jQuery] Re: Determining when an image is fully loaded

2007-04-29 Thread wyo
On 28 Apr., 23:12, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > var $img = $('') > .appendTo('#pictures') > .bind('load', function() { alert('loaded') }); > Thanks, this works. Why do you use "appendTo" instead of "html"? I must say I don't understand the difference. O. Wyss

[jQuery] Re: Determining when an image is fully loaded

2007-04-28 Thread Erik Beeson
Maybe $('#pictures').html(...).children().bind(...) But I think you're trying to hard to use jQuery. How about this (tested on FF2/Mac): var img = new Image(); img.onload = function() { img_width = this.width; img_height = this.height; }; img.src = '...'; $('#pictures').html(img); Or if you wa

[jQuery] Re: Determining when an image is fully loaded

2007-04-28 Thread Mike Alsup
Wyo, Try something like this: var $img = $('') .appendTo('#pictures') .bind('load', function() { alert('loaded') }); But be aware that if the image is already in the browser cache the load event will not fire in IE. You can use the "complete" property to test if the image is loaded: i

[jQuery] Re: Determining when an image is fully loaded

2007-04-28 Thread wyo
On 28 Apr., 15:39, "Sean Catchpole" <[EMAIL PROTECTED]> wrote: > Try this: > $('#pictures').html(...).bind("load",function(){...}); > I've tried $('#pictures').html('').bind ('load', sizeImage); function sizeImage() { alert ('sizeImage'); } The alert is never shown, see http://www.orp

[jQuery] Re: Determining when an image is fully loaded

2007-04-28 Thread Sean Catchpole
Try this: $('#pictures').html(...).bind("load",function(){...}); ~Sean