var element = document.querySelector(".blob");
var blob = element.getBoundingClientRect();
const x = blob.x;
const y = blob.y;
function randomX(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function randomY(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
element.style.left = element.style.left + randomX(x, 1000) + "px";
element.style.top= element.style.top + randomX(y, 1000) + "px";
var element = document.querySelector(".blob");
var blob = element.getBoundingClientRect();
const x = blob.x;
const y = blob.y;
function randomX(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function randomY(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
element.style.left = element.style.left + randomX(x, 1000) + "px";
element.style.top= element.style.top + randomX(y, 1000) + "px";