Add comments to app.js
This commit is contained in:
4
app.js
4
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" });
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user