-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
13 lines (13 loc) · 732 Bytes
/
script.js
File metadata and controls
13 lines (13 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
const modified = document.createElement("p");
const background = document.getElementById("background");
const buttons = Array.prototype.slice.call(document.getElementsByClassName("button"));
const screenHeight = screen.availHeight;
const screenWidth = screen.availWidth;
modified.innerHTML = "This page was last modified on: " + document.lastModified;
background.style.backgroundcolor = "red";
console.log(typeof buttons, buttons.length, buttons[0], buttons);
buttons.forEach(element => {
console.log([screenWidth - element.offsetWidth, screenHeight - element.offsetHeight]);
element.style.marginLeft = String(screenWidth - element.offsetWidth);
element.style.marginTop = String(screenHeight - element.offsetHeight);
});