我有一个 JavaScript Web 应用程序,用户需要抓住背景来移动整个屏幕。所以我希望当它们悬停在背景上时光标发生变化。这-moz-grab
and -moz-grabbing
CSS 光标非常适合此目的。当然,它们仅适用于 Firefox...其他浏览器是否有等效的光标?我是否需要做一些比标准 CSS 光标更自定义的事情?
如果其他人偶然发现这个问题,这可能就是您正在寻找的:
.grabbable {
cursor: move; /* fallback if grab cursor is unsupported */
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
/* (Optional) Apply a "closed-hand" cursor during drag operation. */
.grabbable:active {
cursor: grabbing;
cursor: -moz-grabbing;
cursor: -webkit-grabbing;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)