Showing posts with label show and hide dynamic div by jquery. Show all posts
Showing posts with label show and hide dynamic div by jquery. Show all posts

Tuesday, 30 August 2011

show and hide dynamic div by jquery



  <script>
  $(function () {
    $("a").click(function () {
        var ID = this.id;
        $('.'+ID).toggle();
    });
});

</script>









<?php
$j=0;
while($j<=10)
{
?><p>
 <a href="javascript:void(0);" id="content<?php echo $j; ?>"  class="team-readmore">read more.</a>
</p>
</div>
<div class="content<?php echo $j; ?>"  style="display:none"><?php echo stripslashes($getdata[$j][7]); ?></div>
<?php
$j++;
}
?>