Known Participant
September 8, 2022
Question
Image Grid not displaying photos or working with Firefox
- September 8, 2022
- 4 replies
- 634 views
I am working on an image grid and was hoping somebody could let me know why it isn't displaying properly. Using Safari the image grid works, except it doesn't display my images, instead it shows the image icon. I am able to sort through the image grid but it does not display my images. Previewing in Dreamweaver and it doesn't work at all, the buttons are not responsive and it doesn't show images or icons. Can anybody share some insight into this matter?
<!doctype html>
<html>
<head>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Grid</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="dbgalleryabout.css" rel="stylesheet" type="text/css">
</head>
<body class="background">
<section>
<!-- Header -->
<div>
<button class="btn" onclick="one()">1</button>
<button class="btn active" onclick="two()">2</button>
<button class="btn" onclick="four()">4</button>
</div>
<div class="header" id="myHeader">
<h1 class="content">123 Cedar Ridge, Crested Butte, CO 80463</h1>
<!-- Photo Grid -->
<div class="row">
<div id="myMeo-nav" class="meo-video-nav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="dbgallery-tour-video.html"><i class="fa-solid fa-video" style="font-size:24px"></i> Video</a>
<a href="dbgallery-tour-photos.html"><i class="fa-solid fa-camera" style="font-size:24px"></i> Photo Gallery</a>
<a href="dbgallery-ig.html"><i class="fa-solid fa-image" style="color: white font-size:24px"></i> Image Grid</a>
<a href="dbgallery-brochure-1.html" target="_blank"><i class="fa-solid fa-circle-info" style="color:white font-size:24px"></i> Details</a>
<a href="dbgallery-brochure-1.html" target="_blank" ><i class="fa-solid fa-print" style="color:white font-size:24px"></i> Brochure</a>
<a href="dbgallery-tour-contact.html"><i class="fas fa-map-marker-alt" style="font-size:24px"></i> Map</a>
<a href="dbgallery-tour-contact.html"><i class="fa-solid fa-address-card" style="font-size:24px"></i> Contact</a>
</div>
<div class="column">
<img src="/img/689-outlook-circle-new-castle-co/01-689-outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/02-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/03-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/04-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/05-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/06-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
</div>
<div class="column">
<img src="/img/689-outlook-circle-new-castle-co/07-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/08-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/09-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/10-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/11-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/12-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
</div>
<div class="column">
<img src="/img/689-outlook-circle-new-castle-co/13-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/14-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/15-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/16-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/17-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/18-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
</div>
<div class="column">
<img src="/img/689-outlook-circle-new-castle-co/19-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/20-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/21-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/22-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/23-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
<img src="/img/689-outlook-circle-new-castle-co/24-689outlook-circle-new-castle-co.png" style="width:100%" alt="">
</div>
</div>
</div>
</section>
<script>
// Get the elements with class="column"
var elements = document.getElementsByClassName("column");
// Declare a loop variable
var i;
// Full-width images
function one() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "100%"; // IE10
elements[i].style.flex = "100%";
}
}
// Two images side by side
function two() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "50%"; // IE10
elements[i].style.flex = "50%";
}
}
// Four images side by side
function four() {
for (i = 0; i < elements.length; i++) {
elements[i].style.msFlex = "25%"; // IE10
elements[i].style.flex = "25%";
}
}
// Add active class to the current button (highlight it)
var header = document.getElementById("myHeader");
var btns = header.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function() {
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
</body>
</html>
