WordPress jQuery shortcodes
-
Hi!
I have a jquery code with shortcodes from the plugin draw attention, and im struggling to try to hide some divs shortcodes, before I use jQuery show.
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> jQuery( document ).ready(function() { jQuery('.showSingle').on('click', function() { jQuery('.targetDiv').hide(); jQuery('#div'+$(this).attr('target')).show(); e.preventDefault(); }); }); }); <div class="buttons"> <a class="showSingle" target="1"><button>1</button></a> <a class="showSingle" target="2"><button>2</button></a> <a class="showSingle" target="3"><button>3</button></a> <a class="showSingle" target="4"><button>4</button></a> </div> <div id="div1" class="targetDiv"><?php echo do_shortcode( '[drawattention ID="48"]');?></div> <div id="div2" class="targetDiv"><?php echo do_shortcode( '[drawattention ID="87"]');?></div> <div id="div3" class="targetDiv"><?php echo do_shortcode( '[drawattention ID="92"]');?></div> <div id="div4" class="targetDiv"><?php echo do_shortcode( '[drawattention ID="111"]');?></div>How can i hide div2, div3 and div4, before I click on button?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘WordPress jQuery shortcodes’ is closed to new replies.