Hide div on click with javascript/jquery
-
I am trying to hide a div using on click, I got some code from http://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
-
You’ll have to show us your website
I sorted it with this plugin https://wordpress.org/plugins/itm-simple/
Banners at the botton of page (only appear on mobile) can now be closed/dismissed…I just need to find a way to make the (x) disappear too now ; )
site is: http://www.footballpunt.com
What do you mean by the ‘x’
Most pop ups etc. have a little “x” in a circle on the top right corner used to close the pop up. Your browser window is closed with an “x” again usually top right of your browser. See a screenshot of it here https://i.imgsafe.org/ac902a34ab.jpg
When you click the “x” to close the banner…the “x” remains
Sorry I don’t see the ‘X’ on Chrome
Strange cos I am using Chrome too. You do see the “x” before clicking to close the banner don’t you?
The topic ‘Hide div on click with javascript/jquery’ is closed to new replies.