Smooth scrolling

This commit is contained in:
Jokob-sk
2024-03-05 16:17:52 +11:00
parent 8e85abfda4
commit be81668d6d
3 changed files with 40 additions and 16 deletions

View File

@@ -517,6 +517,9 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
}
setupSmoothScrolling()
}
@@ -757,21 +760,6 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
document.getElementById('lastImportedTime').innerHTML = humanReadable;
// Scroll down if ID in URL
// Get the ID from the URL
var url = window.location.href;
var id = url.substring(url.indexOf("#") + 1);
// Check if the ID exists in the document
if ($("#" + id).length > 0) {
setTimeout(function() {
// Scroll to the element
$('html, body').animate({
scrollTop: $("#" + id).offset().top - 50
}, 1000);
},200);
}
})
@@ -784,6 +772,8 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) {
<script defer>
// -----------------------------------------------------------------------------
// handling events on the backend initiated by the front end START
// -----------------------------------------------------------------------------