From 6f994a680ddc6e09c9384c510011fab7551a4574 Mon Sep 17 00:00:00 2001 From: Matteias Collet Date: Sat, 11 Nov 2017 14:42:12 +0100 Subject: [PATCH] better scrolling --- gctGenerator.js | 23 +++++++++++++++++++++++ index.html | 2 +- style/style.css | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/gctGenerator.js b/gctGenerator.js index 5456a11..67fdd86 100644 --- a/gctGenerator.js +++ b/gctGenerator.js @@ -12,6 +12,29 @@ document.getElementById("checkList").addEventListener("click", function(ev) { } }); +window.addEventListener("scroll", function(e) { + try { + document.getElementById("descriptionBox").style.left = (470 - window.pageXOffset) + "px"; + if (document.getElementById("warningMessage").style.display != "none") { + if(window.pageYOffset > 120) { + document.getElementById("descriptionBox").style.top = "0px"; + } else { + document.getElementById("descriptionBox").style.top = (120 - window.pageYOffset) + "px"; + } + } else { + if(window.pageYOffset > 61) { + document.getElementById("descriptionBox").style.top = "0px"; + } else { + document.getElementById("descriptionBox").style.top = (61 - window.pageYOffset - 11) + "px"; + } + } + + } catch (ex) { + console.log("error"); + } +}); + + function parseXML(name) { var xml = new XMLHttpRequest(); var file = "codes/" + name + ".xml"; diff --git a/index.html b/index.html index ee78377..5cf1f9d 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ - +
diff --git a/style/style.css b/style/style.css index 7374d3d..7777736 100644 --- a/style/style.css +++ b/style/style.css @@ -140,7 +140,7 @@ th { min-height: 150px; overflow-y: auto; overflow-x: hidden; - max-height: 100vh; + max-height: 80vh; -ms-overflow-style: none; } .framed::-webkit-scrollbar {