本文摘自PHP中文网,作者青灯夜游,侵删。
javascript隐藏鼠标的方法:首先使用“document.getElementById("id值")”语句获取指定元素对象;然后使用“元素对象.style.cursor="none"”语句设置鼠标隐藏效果即可。
本教程操作环境:windows7系统、javascript1.8.5版、Dell G3电脑。
javascript隐藏鼠标
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" >
< style >
div{
background-color: palegoldenrod;
padding: 10px;
}
</ style >
</ head >
< body >
< div id = "cursor" >鼠标在div元素上时,会被隐藏!</ div >
</ body >
< script type = "text/javascript" >
var div=document.getElementById("cursor");
div.style.cursor="none";
</ script >
</ html >
|
效果图:
阅读剩余部分
相关阅读 >>
javascript中数组去重的5种方法是什么
javascript关于web推送通知的机制详解
nw.js的localstorage的物理储存实例详解
javascript中进程和线程的区别是什么
javascript有没有集合
javascript什么叫事件源
javascript语句有哪些
javascript包括什么
javascript数据类型分为哪两类
javascript如何删除div标签
更多相关阅读请进入《javascript》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » javascript怎么隐藏鼠标