Довел скрипт до такого вида, не работает все равно.
xm = 0;
ym = 0;
OlsW = lighter.width/2;
OlsH = lighter.height/2;
function Moveimg(){
x = xm;
y = ym;
lighter.style.left = x;
lighter.style.top = y;
setTimeout("Moveimg()",100)
}
function doMouse(){
if(window.event)
{
xm = window.event.x-OlsW;
ym = window.event.y-OlsH;
}
if(window.event)
{
xm = window.event.clientX-OlsW;
ym = window.event.clientY-OlsH;
}
}
document.onmousemove = doMouse;
Moveimg();
|