[jQuery] Re: wait until dynamically generated image has fully loaded

2007-09-29 Thread bytte
Thanks a lot Benjamin. I've posted the issue in a separate thread. On 29 sep, 16:45, "Benjamin Sterling" <[EMAIL PROTECTED]> wrote: > Not sure if I would be able to explain it well, but basically it is > preloading the image and once it is loaded (onload) execute the code, it is > similar to a ca

[jQuery] Re: wait until dynamically generated image has fully loaded

2007-09-29 Thread Benjamin Sterling
Not sure if I would be able to explain it well, but basically it is preloading the image and once it is loaded (onload) execute the code, it is similar to a callback function in jquery. as for the safari issue, not sure, but I believe there was talk about that issue in safari, do a search in the g

[jQuery] Re: wait until dynamically generated image has fully loaded

2007-09-29 Thread bytte
btw, it works fine (after adding the json.picture to the last link as well: img.src = "../layout/images/uploads/"+json.image;) any idea why the animation results in no picture being show in Safari (both mac and windows)? it shows the loading gif, then the old image fades out, the new one fades in

[jQuery] Re: wait until dynamically generated image has fully loaded

2007-09-29 Thread bytte
Thanks for the reply. What exactly is happening with this new Image() thing? On 29 sep, 02:50, "Benjamin Sterling" <[EMAIL PROTECTED]> wrote: > Do something like: > > function showNewPic(json) { > var img = new Image(); > > img.onload = function(){ > $('.jq_loading').hide(); > $('.currentpic')

[jQuery] Re: wait until dynamically generated image has fully loaded

2007-09-28 Thread Benjamin Sterling
Do something like: function showNewPic(json) { var img = new Image(); img.onload = function(){ $('.jq_loading').hide(); $('.currentpic').fadeOut("fast",function() { $('.currentpic').attr({ src: "../layout/images/uploads/"+json.picture}).fadeIn("fast") }); }; img.src = "../layout/images/uploads/";