Fixed button
This commit is contained in:
parent
2b9448fd35
commit
d2934ddf47
@ -353,7 +353,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
const toggleButton = document.getElementById('toggleButton');
|
const toggleButton = document.getElementById('toggleButton');
|
||||||
let isHidden = true; // Initially, only show checked grid items
|
let isHidden = true; // Initially, only show checked grid items
|
||||||
|
|
||||||
|
// Initialize visibility based on isHidden
|
||||||
|
updateVisibility();
|
||||||
|
|
||||||
toggleButton.addEventListener('click', function() {
|
toggleButton.addEventListener('click', function() {
|
||||||
|
// Toggle visibility and update grid items
|
||||||
|
isHidden = !isHidden;
|
||||||
|
updateVisibility();
|
||||||
|
});
|
||||||
|
|
||||||
|
function updateVisibility() {
|
||||||
// Get all grid items
|
// Get all grid items
|
||||||
const gridItems = document.querySelectorAll('.grid-item');
|
const gridItems = document.querySelectorAll('.grid-item');
|
||||||
|
|
||||||
@ -369,10 +378,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
item.style.display = 'none';
|
item.style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
// Invert the visibility state for the next click
|
|
||||||
isHidden = !isHidden;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user