Files
littlelink/app.js
2025-07-24 11:33:38 -04:00

11 lines
372 B
JavaScript

// 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) {
// Scroll to contents of value block when it is opened
valueBlock.scrollIntoView({ behavior: "smooth" });
}
});