Site logo

Archived topic

Close Button on Section

3 replies · Started by Leon on March 13, 2019

Viewing posts 1–4 of 4

Hi Tom,

I've given a section an id of "topBar" and when I click a button, that section will disappear. This is the JS code used:

<script type="text/javascript">
			document.getElementById("closeTopBar").onclick = function(){
				document.getElementById("topBar").style.display = none;
			}
			
		</script>

The code works fine. However, when a user moves to another page, the section will show up again and it's annoying.

Question is: how to make it that when a user clicks the close button on any page, the section will not show up again on any page?

(the section is a global section inserted by hook)

Thank you Tom. Will see if it works out for me.

No problem :)

This archived topic is closed to new replies.