0

toggle(); should hide the div on first click show on second click and hide on third click. But for the first time to show the div I have to click two times.

<div id="wholeinfo_<?php echo $result['userid']; ?>" style="display:none;">

<script type="text/javascript">
    $('.other_chart').live("click",function(e){
        e.preventDefault();
        var userid1= $(this).attr("id").split('_').pop();
        $.ajax({
        type: "POST",
        async: true,
        url: "d3js/index.php",
        data: "userid="+ userid1,
        cache: false,
        //beforesend: function(){$(".podar").show();},
        success: function(html) {
              //$("#loader_"+userid1).hide();
              $("#wholeinfo_"+userid1).empty().append(html).toggle();
            }
        });
    });
</script>
juls
  • 87
  • 2
  • 6

0 Answers0