php - Javascript inside a Wordpress loop -
i trying run javascript inside wordpress loop , won't recognise php variables. want when 1 box clicked show hidden content when box or box clicked again should hide content.
$(document).ready(function(){ $("#show").on("click", function(e) { var target = $(this).attr("href"); $(target).slidetoggle("fast"); $("<?php echo $name; ?>").not(target).hide(); e.preventdefault(); }); });
that inside foreach loop of each custom post type label. have advice? thanks.
maybe work you.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("#on").click(function(){ $("#area want hide/show").toggle(); }); }); </script>
Thanks for give us valuable information
ReplyDeleteContact WordPress Support
WordPress Support Service
Very Helpful. Thanks for such Information
ReplyDeleteWP Help
24x7 WP Support