Preload custom cursors with Javascript

I was able to successfully preload the image gallery before the page loaded, but I was wondering how I can do the same for the user cursor.cur files, since it does not work using the image method below, because it cannot understand the .cur extension?

// Image Preloader var pictures [ "a.jpg", .. "z.jpg" ]; for (var i=0;i < pictures.length; i++){ var img = new Image() img.src = pictures[i]; img.onload = function(){ updateProgress(); } } 
+4
source share
1 answer

Download the ico file using AJAX .get() and ignore the answer. The response must be cached in the browser. Sort of:

  $.get('/favicon.ico', function() { alert('Loading of ICO file completed!'); // Do other processing here }); 

http://jsfiddle.net/BGG2m/

+3
source

All Articles