使用Java预加载自定义游标

问题描述 投票:4回答:2

我已经能够在页面加载之前成功地预加载图像库,但是想知道如何对自定义cursor.cur文件执行相同的操作,因为它不能使用下面的图像方法,因为它无法理解.cur扩展名?

// 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();
    }
}
javascript jquery cursor preload
2个回答
3
投票
使用AJAX .get()加载ico文件,并忽略响应。响应应缓存在浏览器中。类似于:

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

http://jsfiddle.net/BGG2m/

0
投票
人们为什么回答他们的猜测或假设?仅当您确认您在说什么时,才应发布答案?
© www.soinside.com 2019 - 2024. All rights reserved.