From fdf381c8a57f24b573996fb8fd473d45bb4bcd57 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Thu, 11 Apr 2024 08:26:47 +0000 Subject: [PATCH] add jump to time v2 --- css/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/css/app.js b/css/app.js index 17a0123..f2651a2 100644 --- a/css/app.js +++ b/css/app.js @@ -136,8 +136,17 @@ const videoPlayer = document.getElementById('video'); function time(seconds) { videoPlayer.currentTime = seconds; + + // Add #video to the URL + window.location.hash = 'top'; + + // Remove #video after a short delay + setTimeout(() => { + history.replaceState(null, null, ' '); + }, 250); } + document.addEventListener('click', function(event) { const clickedElement = event.target;