How to get two slidetoggle working with JQuery -
basically want piece of code toggle multiple pieces of code whenever they're clicked ,now i'm new jquery , can't seem working .any bit of great
<script> $(document).ready(function () { $("#flip").click(function () { $("#panel").slidetoggle("1000"); }); }); </script> above script,and below code want have effect.
<div class = "description"> <div id="flip"> dog says how ? <div id="panel">hidden text</div> </div> <div id="flip"> dog says how ? <div id="panel">more hidden text</div> </div> the first "panel" work second dormant.
id should unique, need use class instead:
<div class="flip"> dog says how ? <div class="panel">hidden text</div> </div> then can do:
$(".flip").click(function(){ $(this).find(".panel").slidetoggle("1000"); });
Comments
Post a Comment