From 8720015daa5bcfbff0f509319f98fe2de4594d5b Mon Sep 17 00:00:00 2001 From: Mike Rockwell Date: Thu, 24 Jul 2025 11:33:38 -0400 Subject: [PATCH] Add comments to app.js --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 77871be..b27fde8 100644 --- a/app.js +++ b/app.js @@ -1,8 +1,10 @@ +// Set expanded value block to a variable const valueBlock = document.getElementById("value-expanded"); +// Watch for the details element to be toggled document.querySelector('.value-block').addEventListener('toggle', function() { if (this.open) { - // Code to execute when the details are opened + // Scroll to contents of value block when it is opened valueBlock.scrollIntoView({ behavior: "smooth" }); } });