window.onload=function(){
//广告滚动
var oneInner = $('#divid')[0];
//定时器
var a1a = setInterval(moves,10);
//函数
var x = 1;
var y = 1;
function moves(){
var tops = oneInner.offsetTop
var lefts = oneInner.offsetLeft if (lefts>=document.documentElement.clientWidth-oneInner.offsetWidth||lefts<0)
{
x = -x;
} if (tops>=(document.documentElement.clientHeight+document.documentElement.scrollTop)-oneInner.offsetHeight)
{
y = -1;
}
if (tops<=document.documentElement.scrollTop){
y = 1;
} tops+=y;
lefts+=x; oneInner.style.top=tops+"px"
oneInner.style.left=lefts+"px"
}
//悬停停止
oneInner.onmouseover=function(){
clearInterval(a1a);
}
//放手继续运动
oneInner.onmouseout=function(){
a1a =setInterval(moves,10);
}
}
05-22 05:23