![](/img/trans.png)
[英]How can you show and hide the cookies icon in the Chrome address bar?
[英]How can you implement a grabbing cursor icon in Chrome?
我知道可以在Chrome中使用抓取光标图标(当然是在Gmail中),但我无法弄清楚如何在我的代码中实现它。 我试过(在CSS中):
body {
cursor: grab;
}
body {
cursor: -webkit-grab;
}
body {
cursor: url(http://www.worldtimzone.com/mozilla/testcase/css3cursors_files/grab.gif);
}
Chrome在“抓取”名称之前需要-webkit-;
下面是一个适用于Chrome和Mozilla的样式示例,其中包括当您“保持”某些内容时光标的更改。
#eA { cursor: -webkit-grab; cursor:-moz-grab; }
#eA:active { cursor: -webkit-grabbing; cursor:-moz-grabbing;}
参考: https : //developer.mozilla.org/en-US/docs/Web/CSS/cursor
因此,在CSS中,您可以从基础开始,然后转向更加模糊的内容。 浏览器将选择适用于该特定浏览器的最后一个。 无论出于何种原因,Chrome支持webkit-grab但不支持抓取。
body {
cursor: pointer;
cursor: hand;
cursor: -webkit-grab;
cursor: grab;
}
关于您关于操作此操作的能力的后续问题,请尝试使用以下内容:
document.body.style.cursor = 'move';
这是gmail使用的样式,如果这是你想要的精确光标样式:
body {
cursor: url(https://ssl.gstatic.com/ui/v1/icons/mail/images/2/openhand.cur), default !important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.