Skip to content

Commit

Permalink
added z-index const
Browse files Browse the repository at this point in the history
  • Loading branch information
elin001 committed Nov 8, 2023
1 parent 9c3512f commit 30c0c98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 15 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
//menu
const checkbox = document.getElementById('op');
const mainContent = document.getElementById('content');

checkbox.addEventListener('change', function () {
if (checkbox.checked) {
// Checkbox is checked, apply z-index: -1000
mainContent.style.zIndex = '-1000';
} else {
// Checkbox is unchecked, remove the z-index property
mainContent.style.removeProperty('z-index');
}
});

//gif
const gif = document.getElementById('autoplayGif');

Expand All @@ -20,3 +34,4 @@ const handleIntersection = (entries, observer) => {
const observer = new IntersectionObserver(handleIntersection, options);

observer.observe(gif);

1 change: 0 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
main {
display: flex;
flex-flow: column wrap;
z-index: -1000;
}

body {
Expand Down

0 comments on commit 30c0c98

Please sign in to comment.