I've tried to keep this relatively simple and I've spent the past 6 hours trying to get this work so if someone could correct me that'd be amazing.
Desired Behaviour: Clicking image 1 should make it hide, image 2 is already there, clicking image 2 should make image 1 visible again. The user should be able to switch between each image multiple times.
I have managed to make it so that the first image is no longer visible when it is clicked and it shows a second image (which I'm using instead of a button) when the second image is clicked it should display the first image again, I've tried resetting the div but I'm not sure on what the best means would be to make it visible again.
<!--Notice-->
<div class="notice1">
<style>.notice1 { position:fixed; bottom:0%; left:0%; z-index: 2;}</style>
<img class="notice1" img draggable="false" onclick="this.style.display='none';" src="URL FOR IMAGE 1" width="100%" alt=""></div>
<div class="Notice2">
<style>.notice2 { position:fixed; bottom:0%; right: 0%; z-index: 1;}</style>
<img class="notice2" img draggable="false" src="URL FOR IMAGE 2" width="2.5%" alt=""></div>
<script>
function changeVisibility() {
document.getElementById("notice1").style.visibility = "hidden";
}
function resetElement() {
document.getElementById("notice2").style.visibility = "visible";>
</script>
The first snippet works and the first image disappears, I just need it to show the first image again when the second one is clicked.
I'd tried to do this without scripts but I have no idea how. The first image disappears but I do not understand why clicking the first image won't make it disappear again. If you paste in your own image links you'll be able to see what I mean.
If someone could copy my code and make the changes directly that'd be amazing. I think there's something I'm missing and I can't find anything on this website that actually uses the same method as I.
Thanks.