I have designed a Filter Image Gallery where all images are initially displayed when the page loads. There are four different tabs available - Show all, Nature, Cars, and People.
However, I want to change this default behavior so that only Nature filter images are shown by default after the page is loaded.
If you would like to review my code, you can find it here: CodePen Link
You can also view my code snippet below:
filterSelection("all")
function filterSelection(c) {
var x, i;
x = document.getElementsByClassName("column");
if (c == "all") c = "";
for (i = 0; i < x.length; i++) {
w3RemoveClass(x[i], "show");
if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
}
}
// Additional JavaScript functions...
Please note that changing the default display to show only Nature images has been challenging as all images continue to display. Thank you in advance for your help.