Rob*_*b W 10
只需创建一个元素,设置属性,并检查该属性是否仍然存在.
function isCursorNoneSupported() {
var a = document.createElement("a");
a.style.cursor = "none";
return a.style.cursor === 'none';
}
if ( isCursorNoneSupported() ) {
alert("cursor:none is supported!");
} else {
alert("cursor:none is not supported :(");
}
Run Code Online (Sandbox Code Playgroud)
要查看哪些浏览器支持cursor:none,请查看:cursor浏览器兼容性