Hide div on click with javascript/jquery
-
I am trying to hide a div using on click, I got some code from https://codepen.io/senff/pen/fqmFo but I am uncertain if I am using it correctly.
I have this:
<script>// <![CDATA[ jQuery(document).ready(function(c) { $('.alert-close').on('click', function(c){ $(this).parent().fadeOut('slow', function(c){ }); }); }); // ]]></script>
in the footer and it is supposed to use the div “alert-close” to close the parent div which is a div containing a banner ad
I just need a simple way to get this script into the footer where the banner ad resides
Any ideas? Is there a simple way to drop it into the footer that doesn’t involve registering scripts and messing around in functions.php?
Thanks in advance
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Hide div on click with javascript/jquery’ is closed to new replies.