光标在Firefox Mac上消失并且没有重置
Cursor disappears on Firefox Mac and doesn't reset
我正在开发一个网页,我需要隐藏光标在一个特定的区域(div)和显示自定义光标在另一个区域。它在所有浏览器上都能很好地工作,但只有在Firefox Mac上,光标隐藏起来,再也不会回来。我已经拿出了这段代码,这是导致这个问题(JSFiddle链接)。
$( "#left" ).mousemove(function( event ) {
leftDiv.style.cursor = "none";
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);
});
下面是如何复制的尝试在空白区域和文本区域之间连续移动光标,在某些时候光标完全消失,根本看不见。这可以通过一些工作来解决吗?我在这里看到firefox的一个bug
不使用"none"属性来隐藏光标,如果我们使用一个带有"auto"属性的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中指定的资源不存在,那么浏览器的默认光标将显示而不是隐藏。
相关文章:
- 为什么这在IE中的工作方式与在Firefox中不同
- facebook”;添加评论“;popup获胜'不要消失
- JS可以在Chrome中工作,但不能在Firefox中工作
- 为什么js事件消失了
- createElement("a") - FireFox JavaScript
- 为什么javascript:void(0)在Firefox中不起作用
- JS文件的路径正在消失
- Facebook登录按钮没有'不能在Firefox上工作
- jpm的默认Firefox路径没有'不起作用
- I'我设计了一个下拉菜单,onclick会出现,而on blur会消失
- 重载JS'firefox中的对象原型
- Ajax调用在Firefox中不会自动响应
- SVG在转换时消失在firefox中
- iframe内容在Firefox上消失
- getUserMedia权限对话框在FireFox中消失
- Firefox使简单的jquery slidetoggle()消失
- 弹出链接在firefox中点击1次后消失
- 在下面的代码中,在Fabric.js中单击鼠标时,Canvas层消失,Firefox在创建画布到图像时停止响应
- 光标在Firefox Mac上消失并且没有重置
- 粘性导航栏在Firefox中消失