
top:0px; width:50px; height:50px;" />
Random Position
function RandomPositions() {
var Hero = document.getElementById("image");
var x = Math.floor(Math.random() * 300);
var HeroX = Hero.style.left;
HeroX = x + 'px';
var y = Math.floor(Math.random() * 300);
var HeroY = Hero.style.top;
HeroY = y + 'px';
}
Подробнее здесь: https://stackoverflow.com/questions/404 ... mg-element