You may find a faster answer to this question here: www.stackoverflow.com
On Dec 31 2008, 6:45 pm, Walter Lee Davis <wa...@wdstudio.com> wrote: > I have a bunch of images that I am preloading inside of a loop. One of > these images is also loaded by the html, so I get a good look at how > these two different methods perform. For measurement, I am using the > Network pane of the Safari Web Inspector, after clearing the cache. > > The ClownFish image referenced by the HTML is 280KB, and takes 14ms to > load, while one of the Aurora image referenced by JS in the preload is > 116KB and takes 77ms to load. > > var images = ['Aurora', 'ClownFish', 'DewDrop', 'EarthHorizon', > 'FlowingRock', 'GentleRapids', 'GoldenPalace']; > images.each(function(elm){ > var path = elm + '.jpg'; > var preload = new Image(); > preload.setAttribute('src',path); > > }); > > Is this all overhead from setting up the Image() and then assigning > the src to it? Is there any way to speed this up? > > Thanks in advance (and happy new year), > > Walter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---