Skip to content

Commit

Permalink
fixed mobile nav via z-index change on modal.show
Browse files Browse the repository at this point in the history
  • Loading branch information
dcnb committed Mar 28, 2024
1 parent f33cc98 commit a96f587
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
18 changes: 18 additions & 0 deletions _includes/js/homepage-zindex-js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
document.addEventListener('DOMContentLoaded', function() {
// Select the modal and the tv image container
var offcanvasNavbar = document.getElementById('offcanvasNavbar');
var tvImageContainer = document.getElementById('tvimage-container');

// Listen for the show event
offcanvasNavbar.addEventListener('show.bs.offcanvas', function () {
tvImageContainer.style.zIndex = "-1"; // Set z-index to -1 when modal is shown
});

// Listen for the hide event
offcanvasNavbar.addEventListener('hide.bs.offcanvas', function () {
tvImageContainer.style.zIndex = ""; // Remove z-index when modal is hidden
});
});

</script>
4 changes: 2 additions & 2 deletions _layouts/mainstreet-home.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
# Default home page with boxes providing collection stats
layout: default
custom-foot: js/interviews-js.html;js/youtube-clips-modal.html
custom-foot: js/interviews-js.html;js/youtube-clips-modal.html;js/homepage-zindex-js.html
---
<div class="container-fluid">

<div class="row my-2">

<div class="col-12 col-lg-6 py-0 text-center">
<div class="tvimage-container position-relative">
<div id="tvimage-container" class="position-relative">
<a data-bs-toggle="modal" data-bs-target="#videoClipModal" data-bs-youtubeid="NVs2-8j8bh4">
<!-- Ensure this a-tag has the stretched-link class to make the entire div clickable -->
<figure class="figure mx-3">
Expand Down
8 changes: 4 additions & 4 deletions _sass/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,25 @@

// Home page TV effect with button

.tvimage-container {
#tvimage-container {
cursor: pointer;
overflow: hidden;

}

.tvimage-container:hover figure img {
#tvimage-container:hover figure img {
filter: brightness(85%);
}

.tvimage-container .figure {
#tvimage-container .figure {
margin: 0;
}

.position-absolute {
z-index: 2;
}

.tvimage-container a::before {
#tvimage-container a::before {
content: "";
position: absolute;
top: 0;
Expand Down

0 comments on commit a96f587

Please sign in to comment.