Perhaps you could use something like this: $.preloadImages = function() { for(var i = 0; i<arguments.length; i++) { img = new Image(); img.src = arguments[i]; } }
Then you call it as soon as possible (it doesn't have to be in $(document).ready): $.preloadImages("foo.gif", "bar.gif"); $(document).ready(function() { ... }); On 28/09/06, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > is there a preferred way to preload images when site uses jquery? how > do you usually preload images? > > Aljosa Mohorovic > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/