From 140365b77f51fe7b72ef480540faac6e3825120b Mon Sep 17 00:00:00 2001 From: olaf michaelis Date: Wed, 14 Feb 2024 11:27:15 +0100 Subject: [PATCH] Fix map marker click scroll to top --- js/func.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/func.js b/js/func.js index 89324982..041c74a1 100644 --- a/js/func.js +++ b/js/func.js @@ -40,11 +40,12 @@ function len_minus_one(arr) { function open_marker(id, coords, desc_length) { coords = [coords[0] + (0.0007 * desc_length), coords[1]] + var off = $('#map').offset() map.setView(coords, 9) for (var i in markers) { if (markers[i].id == id) { window.scrollTo({ - top: 0, + top: off.top - 150, behavior: 'smooth', }) markers[i].openPopup()