javascript - mouse cursor change based on event - Stack Overflow

I have an ajax request that I'm sending. When the request starts, I have document.body.style.curso

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 badges
Add a ment  | 

2 Answers 2

Reset to default 7

just 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742393330a4435447.html

相关推荐

  • javascript - mouse cursor change based on event - Stack Overflow

    I have an ajax request that I'm sending. When the request starts, I have document.body.style.curso

    2天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信