From 365ca532187720eb7903b7d9e701ef4ad0fe234b Mon Sep 17 00:00:00 2001 From: Luca Trupiano Date: Fri, 24 Feb 2023 19:53:06 +0100 Subject: [PATCH] spostata scrollbar a dx --- index_4.2.html | 6 ++++-- js/minimap.js | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/index_4.2.html b/index_4.2.html index 17b003a..c178dd6 100644 --- a/index_4.2.html +++ b/index_4.2.html @@ -411,7 +411,9 @@
-
+
+
+
@@ -1053,7 +1055,7 @@
-
+
diff --git a/js/minimap.js b/js/minimap.js index 1ada5e6..4875356 100644 --- a/js/minimap.js +++ b/js/minimap.js @@ -3,6 +3,7 @@ */ const displayCantoId = '#displaycanto'; +const displayCantoWrapperId = '#displaycantoWrapper'; const minimapviewerId = '#minimapviewer'; const displayminimapId = '#displayminimap'; const visCantoClass = '.visCanto'; @@ -40,7 +41,7 @@ function drawMinimap(name){ stop: function(event, ui) { minimapScrolling = false; }, drag: function(event, ui) { minimapScrolling = true; - $(displayCantoId).scrollTop((ui.offset.top - minimapTopPos) / realScale); + $(displayCantoWrapperId).scrollTop((ui.offset.top - minimapTopPos) / realScale); } }); } @@ -88,7 +89,7 @@ function showMinimap() { getDimensionsDiv(); - window.addEventListener('resize', getDimensionsDiv); + //window.addEventListener('resize', getDimensionsDiv); } @@ -127,7 +128,8 @@ function showMinimap() { function trackScrollCanto() { //var minimapHeight = $(displayminimapId)[0].clientHeight; var minimapHeight = ($(currentMinimap)[0].clientHeight+32)*realScale; - var posDbefore = $(displayCantoId).scrollTop(); + //var posDbefore = $(displayCantoId).scrollTop(); + var posDbefore = $(displayCantoWrapperId).scrollTop(); //console.log(posDbefore); var srcCantoHeight = $(currentMinimap)[0].clientHeight; var posAfter = (minimapHeight*posDbefore)/(srcCantoHeight*1.005);