source: extensions/stripped/js/preload.js @ 12153

Last change on this file since 12153 was 12153, checked in by Zaphod, 13 years ago

version 1.5.0

File size: 565 bytes
Line 
1$(window).load(function() {
2    setTimeout(function() {
3     // Prefetch all files referenced in prefetch tags
4     var $prefetchTags = jQuery('HEAD LINK[rel=prefetch][href]');
5
6     // preload all prefetched image links
7     $prefetchTags.filter('[href$=.jpg],[href$=.jpeg]')
8     .each(function() {
9             new Image().src = this.href;
10     });
11         
12     // preload all images with class=preload
13         var $preload = jQuery(".preload");
14     $preload.each(function() {
15            new Image().src = jQuery(this).html();
16     });
17
18    }, 0);
19});
Note: See TracBrowser for help on using the repository browser.