I'm attempting to change the mouse cursor programmatically using JS/CSS, and here's my problem: it seems that Chrome will *force the pointer back to the default pointer no matter what one sets it to.
Here's a minimal example that illustrates the problem:
<html>
<head>
<style type="text/css">
div#mouse_test
{
cursor: crosshair;
}
</style>
<body>
<div id="mouse_test">Here is a small div</div>
</body>
</html>
When I view the above example in Firefox, it works as expected, in that mousing over the text of the div changes the cursor to a crosshair.
When I view it in Chrome, though, the cursor changes to a crosshair then (after about a second) changes back to the default pointer.
Does anyone have any insights? Is it true that Chrome forces the default pointer? If so, is there any way to get around that?
Any help would be greatly appreciate开发者_JS百科d. Thanks!
FIXED
Turns out that restarting my browser fixed the issue. Still odd, though, as I was seeing the problem behavior on *every page that changed the mouse cursor- the one I was working on, as well as several pages with CSS cursor examples that I was viewing. I was working with JS timers to set the cursor, so it's possible that one of those was hanging around in the background. Still odd, since the behavior was completely consistent across multiple tabs.
Big thanks to the Stack Overflow community for the quick and helpful responses :)
That doesn't happen for me in Chrome 9.
So I don't believe it forces the pointer.
Restart your browser and try again (sometimes my cursor flickers between the pointer and normal).
精彩评论