我编写了一个代码,使 div 跟随窗口导航器上的鼠标,这里是代码:
<script type='text/javascript'>
window.onload = function()
{
window.onmousemove = function(event)
{
var evento = event || window.event;
var bloque = document.getElementById('x');
bloque.style.top = evento.clientY+'px';
bloque.style.left = evento.clientX+'px';
}
}
</script>
块状
它适用于Firefox,但不适用于IE。它根本不做任何事情。我做错了什么?