admin管理员组文章数量:1415145
What I want is specify cursor:pointer for the whole body tag, so the background of the page is clickable, but I also want the remainder of the page to work as it did, so I try setting cursor:auto for div, which contains the page.
In FF, Chrome and safari it works fine, also in IE 6 and 7. But it seems that IE 8 and 9 and also (screw it) OPERA have their own opinion on what cursor:auto means.
Here is a snippet to see what happens:
<!DOCTYPE html>
<html>
<head>
<title>Cursor test</title>
</head>
<body>
<div id="newBody" style="width:400px; height:300px; cursor:pointer; background:#ffddee; border:2px solid #ddaa66;">
<div id="pageContent" style="width:200px; cursor:auto; background:#fff;">
<p>This is a paragraph <a href="">click here</a>.</p>
</div>
</div>
</body>
</html>
Although this is an HTML snippet everything is done with javascript with the same oute.
The standard says something really vague: The UA determines the cursor to display based on the current context. , also these pages didn't help on the issue
.html
.85%29.aspx
.asp
Can anyone explain this behaviour or know a possible way around it?
What I want is specify cursor:pointer for the whole body tag, so the background of the page is clickable, but I also want the remainder of the page to work as it did, so I try setting cursor:auto for div, which contains the page.
In FF, Chrome and safari it works fine, also in IE 6 and 7. But it seems that IE 8 and 9 and also (screw it) OPERA have their own opinion on what cursor:auto means.
Here is a snippet to see what happens:
<!DOCTYPE html>
<html>
<head>
<title>Cursor test</title>
</head>
<body>
<div id="newBody" style="width:400px; height:300px; cursor:pointer; background:#ffddee; border:2px solid #ddaa66;">
<div id="pageContent" style="width:200px; cursor:auto; background:#fff;">
<p>This is a paragraph <a href="">click here</a>.</p>
</div>
</div>
</body>
</html>
Although this is an HTML snippet everything is done with javascript with the same oute.
The standard says something really vague: The UA determines the cursor to display based on the current context. , also these pages didn't help on the issue
http://www.w3/TR/CSS2/ui.html
http://msdn.microsoft./en-us/library/aa358795%28v=vs.85%29.aspx
http://www.w3schools./cssref/pr_class_cursor.asp
https://developer.mozilla/en/CSS/cursor
Can anyone explain this behaviour or know a possible way around it?
Share Improve this question asked Jan 10, 2012 at 8:00 OlgaOlga 1,6901 gold badge22 silver badges34 bronze badges2 Answers
Reset to default 6Use CSS:
#pageContent {cursor:default}
#pageContent * {cursor:auto}
The cursor still ends up always being 'default' in IE, but at least other browsers display the expected behaviour.
I think auto is inheriting the parent style (not sure), I tried cursor:default;
and It worked fine in IE 8 and FF 3.6.
<div id="newBody" style="width:400px; height:300px; cursor:pointer; background:#ffddee; border:2px solid #ddaa66;">
<div id="pageContent" style="width:200px; cursor:default; background:#fff;">
<p>This is a paragraph <a href="">click here</a>.</p>
</div>
</div>
本文标签: javascriptcursorauto behaviour in IE 8 and 9Stack Overflow
版权声明:本文标题:javascript - cursor:auto behaviour in IE 8 and 9 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745221009a2648394.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论