I want to make a conditionnal from the execution of a script. When a window inside the browser is at 100% width and 100% height, I want to disable a script from running. The script is the one here https://stackoverflow.com/a/71189606/9444690
element = document.getElementById("window");
let heightPercentage = Math.round(
(element.clientHeight / window.innerHeight) * 100
);
let widthPercentage = Math.round(
(element.clientWidth / window.innerWidth) * 100
);
if (heightPercentage < 100 && widthPercentage < 100) {
makeResizable(element, 400, 225, 10);
}
function makeResizable(element, minW = 100, minH = 100, size = 20) { ...
I tried this and I also tried to change the type of the script on the push of a button. It changed to type="application/JSON" as mentionned in this post: https://stackoverflow.com/a/26483433/9444690 but nothing happened.