php - How to jQuery fadeIn() fadeOut() a text in a div in WordPress -
im trying create 2 buttons can fadein()
, fadeout()
wordpress menu using id
or class
, not working... in example below, i'm trying use id
. when change #menu_jquery
use p
tag works perfect...
<script> $(document).ready(function(){ $(".btn1").click(function(){ $("#menu_jquery").fadeout(); }); $(".btn2").click(function(){ $("#menu_jquery").fadein(); }); }); </script> <button class="btn1">hide menu</button> <button class="btn2">show menu</button> <div id="menu_jquery"> <?php #wp_page_menu( 'sort_column=menu_order' ); ?> </div>
it works jsfiddle.
are sure you've put script tags around javascript?
<script> $(document).ready(function() { $(".btn1").click(function() { $("#menu_jquery").fadeout(); }); $(".btn2").click(function() { $("#menu_jquery").fadein(); }); }); </script>
Comments
Post a Comment