Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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 光标在Firefox Mac上消失,不会';t重置_Javascript_Css_Macos_Firefox_Osx Elcapitan - Fatal编程技术网

Javascript 光标在Firefox Mac上消失,不会';t重置

Javascript 光标在Firefox Mac上消失,不会';t重置,javascript,css,macos,firefox,osx-elcapitan,Javascript,Css,Macos,Firefox,Osx Elcapitan,我正在开发一个网页,需要在其中隐藏特定区域(div)中的光标,并在另一个区域中显示自定义光标。 它在所有浏览器上都能完美工作,但就在Firefox Mac上,光标会隐藏并且永远不会回来。我已取出导致此问题的代码() 这里是如何复制它的- 尝试在空白区域和文本区域之间连续移动光标,在某个点光标完全消失,完全看不见。这可以通过一些变通措施来解决吗?我看到firefox上报告了一个bug,而不是使用“none”属性来隐藏光标,如果我们使用一个URL并将其回退为“auto”,它就工作了 $( "#lef

我正在开发一个网页,需要在其中隐藏特定区域(div)中的光标,并在另一个区域中显示自定义光标。 它在所有浏览器上都能完美工作,但就在Firefox Mac上,光标会隐藏并且永远不会回来。我已取出导致此问题的代码()

这里是如何复制它的- 尝试在空白区域和文本区域之间连续移动光标,在某个点光标完全消失,完全看不见。这可以通过一些变通措施来解决吗?我看到firefox上报告了一个bug,而不是使用“none”属性来隐藏光标,如果我们使用一个URL并将其回退为“auto”,它就工作了

$( "#left" ).mousemove(function( event ) {
leftDiv.style.cursor = "url('http://www.jholjhaal.com/wp-content/uploads/2013/05/HiddenCursor.cur'), auto";
console.log("Left - " + leftDiv.style.cursor);
});

$( "#right" ).mousemove(function( event ) {
rightDiv.style.cursor = "url('http://cur.cursors-4u.net/cursors/images11/cur1047.png'), auto";
console.log("Right - " + rightDiv.style.cursor);
});
这种方法的问题是,如果url中指定的资源不存在,那么浏览器的默认光标将显示而不是隐藏。

如果我们使用带有回退功能的url作为“自动”,则不会使用“无”属性来隐藏光标。

$( "#left" ).mousemove(function( event ) {
leftDiv.style.cursor = "url('http://www.jholjhaal.com/wp-content/uploads/2013/05/HiddenCursor.cur'), auto";
console.log("Left - " + leftDiv.style.cursor);
});

$( "#right" ).mousemove(function( event ) {
rightDiv.style.cursor = "url('http://cur.cursors-4u.net/cursors/images11/cur1047.png'), auto";
console.log("Right - " + rightDiv.style.cursor);
});
这种方法的问题是,如果url中指定的资源不存在,那么浏览器的默认光标将显示而不是隐藏