Recommended Javascript Image preloader [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
开发者_StackOverflow Improve this questionThere are a couple of tools and several tutorials (even some including links to github) on how to preloading images and other artifacts, like css and scripts. YUI3 preloader seems to be the most reliable one.
Is there a better one? Are there any others that are faster (possibly through parallel loading), more usable or has better browser compatibility? Maybe one that uses jquery instead of YUI...
I like the jquery preload plugin. Try this.........
http://plugins.jquery.com/project/Preload
As a suggestion, you can use a lazy loader such as this one to only load images once they are have been scrolled and are in the viewport.
This one is the best.
(new Image).src = '/path/to/image/to/preload';
To preload other things (thanks Daniel) you can try this:
document.createElement('object').data = '/path/to/resource/to/preload';
精彩评论