【发布时间】:2010-11-30 11:59:44
【问题描述】:
假设我们有如下简单的 jQuery 代码:
var $document = $(document);
$document.ready(function() {
var $test = $("#test");
$document.keydown(function(e) {
e.shiftKey && $test.css("cursor", "pointer");
});
});
问题在于,如果鼠标指针移到#test 块上,然后按下 Shift 键,WebKit 不会更改 #test 块鼠标光标。但是,只要您移动光标,Chrome 和 Safari 就会将光标样式更改为 pointer - 完全符合预期,但没有鼠标移动。这个bug(?)与火狐无关,在Internet Explorer和Opera下也没查到……
那么,有没有人遇到过同样的麻烦?也许,有解决方法吗?
提前致谢。
【问题讨论】:
-
已在 Chrome 7.0.517.44 中验证。以前肯定注意到过,这很烦人。
标签: jquery css webkit mouse-cursor onmousemove