【发布时间】:2010-07-12 13:11:27
【问题描述】:
当鼠标进入body元素的矩形(50、50、100、100)(数字以像素为单位)时,我想将光标从default更改为pointer。
我知道我可以定义一个div,把它放在这个位置,然后在上面设置cursor: pointer;,但是我正在寻找一些不定义div的方法。
我想要类似的东西:
if (mousePosition inside rectangle) {
change cursor to pointer
} else {
change cursor to default
}
这样可以吗?
【问题讨论】:
-
在 mousemove 上更改容器的光标。
标签: javascript jquery html css cursor