如何使按钮无法被捉到
大家肯定都知道这个情况吧,就是在界面上有一个按钮,当鼠标移动到它上面时它就随机跑到另外一个位置,只要鼠标移动上去它就跑,我想知道按钮的这个移动是怎么实现的,谢谢!
<input type=\"button\" value=\"button\" style=\"position:absolute;\" onmousemove=\"this.style.left = Math.ceil(Math.random()*screen.width); this.style.top = Math.ceil(Math.random()*screen.height);\" />
太感谢了啊!问下style="positon:absolute;"这句是什么意思?有什么用吗?
绝对定位
onmousemove是鼠标移动的事件,onmouseover是鼠标移动到对象上面的时候触发的事件