Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何通过jQuery设置光标图像?_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript 如何通过jQuery设置光标图像?

Javascript 如何通过jQuery设置光标图像?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,在web应用程序中,我有一个加载事件。如果浏览器正在从服务器加载数据,我希望光标更改为显示时钟的gif。如何更改光标的外观。我只在博客中发现了以下内容: $(this).css('cursor','move'); 我想改为加载图像。请尝试以下方法: $(this).css( 'cursor', 'url(cursor.png), auto' ); 这里是JSFiddle: auto参数告诉您,如果找不到光标图像,将使用哪种光标类型。(请参阅更多光标类型,另一个示例)如果希望光标成为您选择的光

在web应用程序中,我有一个加载事件。如果浏览器正在从服务器加载数据,我希望光标更改为显示时钟的gif。如何更改光标的外观。我只在博客中发现了以下内容:

$(this).css('cursor','move');
我想改为加载图像。

请尝试以下方法:

$(this).css( 'cursor', 'url(cursor.png), auto' );
这里是JSFiddle:

auto
参数告诉您,如果找不到光标图像,将使用哪种光标类型。(请参阅更多光标类型,另一个示例)

如果希望光标成为您选择的光标,可以使用css cursor属性,如上文所述,但url值为:

$(this).css('cursor', 'url(/path/to/image),auto');
或者对身体内部的所有人:

$('body').css('cursor', 'url(/path/to/image),auto');

据我所知,这在Opera中不起作用。

auto代表什么?我想创建一个类,但需要在IE中的.cur文件中放置“auto”