source: extensions/stripped_responsive/js/preload.js @ 29449

Last change on this file since 29449 was 29449, checked in by JanisV, 10 years ago

Initial commit

  • Property svn:executable set to *
File size: 570 bytes
Line 
1jQuery(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.