@ John Resig <[EMAIL PROTECTED]> :
> With jQuery 1.0, you should be able to write your plugin like this:
> $.fn.image = function(src, f){
> return this.each(function(){
> $("<img>").appendTo(this).src( src ).load( f );
> });
> };
>
> Helps to make things a little bit simpler.
Yes it works too, and is much nicer :)
funny thing is that if you replace the main line by:
$("<img>").src( src ).load( f ).appendTo(this);
then the image will display before the alert() fires.
Whereas with your line above (as with my original function) the alert fires
before the image displays (all this in Safari, as with FF it displays and
alerts in both cases.
Might this help explain a part of Safari's oddities (??).
> I like the idea of having the callback for image loading - a smart move.
Me too. It was sDisk's idea.
-- Fil
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/