From: Jack C. <jac...@ne...> - 2003-08-01 02:30:39
|
Hi, Is there any way I can change the src of an image so that the change occurs AFTER the new image has been loaded? Normall I do it like this: var pic=dynapi.functions.getImage('mypic.jpg', 100,100); picarea=new DynLayer("", 0,0,100,100); picarea.setHTML(pic.getHTML()); Then when I want to change picture src, i do: pic.src='newpic.jpg'; picarea.setHTML(pic.getHTML()); However, the original picture becomes blank, then the new image slowly appear as it is being downloaded. Is there anyway I can let it finish loading first, then display? I cannot preload the image at load time because the new image src URL is input by user. So, I want : User says change image > small delay (nothing changes on screen) > new image appear instantly Or, at least during the download time, keep the original image there... I don't want it be blank. Any input is appreciated! Jack -- Jack Chung <jac...@ne...> http://www.PerceptiveCorner.com/ |