Site logo

Archived topic

"Head Scripts" element used in the "Volume"

7 replies · Started by Marcel on July 17, 2020

Viewing posts 1–8 of 8

Could you please tell me what the "Head Scripts" hook element used in the "Volume" theme does?
This is the script:

<script>
function showMe (it, box) {
  var vis = (box.checked) ? "none" : "block";
  document.getElementsByClassName(it)[0].style.display = vis;
}
</script>

Thank you.

Simple thank you!

No problem :)

Hi Leo,

I have the same question as Marcel as I have the Head Scripts Element in my GP theme (not volume), but the script is the exact same and I have no idea what it does. Unfortunately, I looked at the link you sent Marcel and it was not simple to me.

Can you please tell me what it does? I guess I'm not as technical as Marcel.

This is the script in "Head Scripts" element (same as OP posted)--

<script>
function showMe (it, box) {
  var vis = (box.checked) ? "none" : "block";
  document.getElementsByClassName(it)[0].style.display = vis;
}
</script>'

Much appreciated!
Alan

Ahh you are right, that is what it does. The person who built my site original put that sole snippet of code to hook on wp_head for some reason. Not sure why, but I just changed to the hook that David mentions in his thread and the comment toggle still works fine. Seems inefficient to run it in the head I would think (I'm working on speed improvements).

Thank you!

No problem :)

This archived topic is closed to new replies.