在这个小提琴中,你可以抓住并拖动黑框围绕一个圆圈
当用户抓住黑匣子但是他们的光标位于#marker
元素之外且文档内部时,如何显示mousedown光标(closedhand)而不是默认光标。
答案 0 :(得分:3)
<强> CSS 强>
// removed the !important flag here
cursor: url(https://mail.google.com/mail/images/2/openhand.cur), default;
// removed the div#marker here
.mouseDown {
<强> JS 强>
在doc ready上添加了这个:
$(document).on('mouseup', function(event) {
$('body').removeClass("mouseDown");
});
在你的mousedown函数中添加了这个:
$('body').addClass("mouseDown");
答案 1 :(得分:0)
只需将cursor
样式应用于整个<html>
即可。 Updated jsFiddle