Add JavaScript auto scroll when opening the value block
This commit is contained in:
8
app.js
Normal file
8
app.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const valueBlock = document.getElementById("value-expanded");
|
||||
|
||||
document.querySelector('.value-block').addEventListener('toggle', function() {
|
||||
if (this.open) {
|
||||
// Code to execute when the details are opened
|
||||
valueBlock.scrollIntoView({ behavior: "smooth" });
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user