You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
409 B
JavaScript
17 lines
409 B
JavaScript
const container = document.getElementById("container");
|
|
// console.log(container.children);
|
|
|
|
let contents = Array.from(container.children);
|
|
// console.log(images);
|
|
|
|
contents.forEach((item) => {
|
|
console.log(item);
|
|
left = Math.random() * 100;
|
|
top = Math.random() * 100;
|
|
zIndex = Math.round(Math.random() * 1000);
|
|
|
|
item.style.left = left + "%";
|
|
item.style.top = top + "%";
|
|
item.style.zIndex = zIndex;
|
|
});
|