var buru=2;
var posleft=100;
var postop=100;
function move(){
obj=document.getElementsByTagName("p");
for(i=0;i<obj.length;i++){
obj[i].style.position="absolute";
obj[i].style.left = posleft+"px";
obj[i].style.top = postop+"px";
}
buru *=-1;
posleft +=buru*Math.random();
postop +=buru*Math.random();
setTimeout(move,100);
}
var addListener =function(elm, type, func){
if(! elm){return false;}
if(elm.addEventListener){/*W3C*/
elm.addEventListener(type, func, false);
}else if(elm.attachEvent){/*Internet Explorer*/
elm.attachEvent('on'+type, func);
}else{
return false;
}
return true;
};
addListener(window, "load", move);
|