Files
littlelink/app.js

11 lines
372 B
JavaScript
Raw Normal View History

2025-07-24 11:33:38 -04:00
// Set expanded value block to a variable
const valueBlock = document.getElementById("value-expanded");
2025-07-24 11:33:38 -04:00
// Watch for the details element to be toggled
document.querySelector('.value-block').addEventListener('toggle', function() {
if (this.open) {
2025-07-24 11:33:38 -04:00
// Scroll to contents of value block when it is opened
valueBlock.scrollIntoView({ behavior: "smooth" });
}
});