javascript - anchor 标记中的 Firefox CSS 光标属性

标签 javascript html css firefox cursor

在 Firefox 3.6.10 和 3.6.7 中,当首次加载页面并且鼠标指针位于链接上方时,它会变成一只手。但是,当我通过 javascript 将 anchor 标记光标样式设置为自动并将鼠标指针悬停在同一 anchor 标记上时,现在它显示为纯文本。在 IE8 和 Chrome 中,它按预期工作(我)。

我理解错了吗?

<html lang="en">
<head>
<script type="text/javascript">
function cursor_auto() {
    document.getElementById('anchor').style.cursor = 'auto';
}
function cursor_pointer() {
    document.getElementById('anchor').style.cursor = 'pointer';
}
</script>
</head>
<body>
<a href="http://example.com" id="anchor">Example</a>
 <input type="button" onclick="cursor_auto();" value="Cursor Auto">
 <input type="button" onclick="cursor_pointer();" value="Cursor Pointer">
</body>
</html>

最佳答案

http://webdesign.about.com/od/styleproperties/a/aa060607.htm

Auto tells the browser to do whatever it would normally do in this situation. It's like a "reset to defaults" option for your cursor.

据此,Firefox 没有 pointer 作为默认光标...或类似的东西。

关于javascript - anchor 标记中的 Firefox CSS 光标属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3772296/

相关文章:

单击更改正文不透明度的jquery

javascript - 选择日期选择器的父元素

javascript - 正则表达式精确文本匹配不起作用

javascript - Rails - 客户端验证问题

javascript - 将上下文传递给 ngx bootstrap 的工具提示

javascript - 如何在 HTML 中插入变量

html - CSS 垂直对齐 : baseline with tables, 表单和 div

css - wp_bootstrap_navwalker 子菜单点击或悬停不显示子菜单

javascript - 我如何优雅地评估 javascript 中的连续范围?

HTML 页脚样式