2019-07-17 15:45:34 +02:00

13 lines
292 B
JavaScript

var x = 0, y = 0;
function m() {
x += (Math.random() >= 0.4 ? 1 : -1 ) * (Math.random() * 5);
y += (Math.random() >= 0.4 ? 1 : -1 ) * (Math.random() * 5);
s = document.getElementById('search');
s.style.left = x;
s.style.top = y;
}
window.onload = function () {
setInterval(m, 200);
};