admin管理员组文章数量:1335611
I have an ajax request that I'm sending. When the request starts, I have
document.body.style.cursor = "wait";
which immediately changes the appearance of the cursor to a spinning circle.
When the request ends, I have
document.body.style.cursor = "default";
However, this only returns the cursor to its original state when the user moves the mouse; if the mouse stays still, the cursor won't change. When you set it to "auto" or any other kind, the cursor change will only trigger when it moves.
Any ideas?
I have an ajax request that I'm sending. When the request starts, I have
document.body.style.cursor = "wait";
which immediately changes the appearance of the cursor to a spinning circle.
When the request ends, I have
document.body.style.cursor = "default";
However, this only returns the cursor to its original state when the user moves the mouse; if the mouse stays still, the cursor won't change. When you set it to "auto" or any other kind, the cursor change will only trigger when it moves.
Any ideas?
Share Improve this question edited Feb 14, 2011 at 2:03 kirilloid 14.3k6 gold badges42 silver badges54 bronze badges asked Feb 14, 2011 at 0:58 frenchiefrenchie 52.1k117 gold badges320 silver badges527 bronze badges2 Answers
Reset to default 7just scroll window by 0,0.
document.body.style.cursor = "auto";
window.scroll(0, 0);
// tested in IE8 and FF3.6
And when the request ends, you need to set cursor to "auto", not a "default". You can see the difference on any element with text.
It's a chrome bug: http://code.google./p/chromium/issues/detail?id=26723
本文标签: javascriptmouse cursor change based on eventStack Overflow
版权声明:本文标题:javascript - mouse cursor change based on event - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742393329a2466423.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论