在php中按钮点击隐藏ul ?>
<li style='width:115px;margin-left:7px;word-wrap:break-word;'><?php echo $row['title'];?></li>
<li style='width:90px;margin-left:7px;word-wrap:break-word;'><?php echo $row['status'];?></li>
<li style='width:80px;margin-left:7px;word-wrap:break-word;'><?php echo $row['added_date'];?></li>
<li style="width:40px;text-align:left;margin-left:5px;"><a href="<?php echo $url;?>?p=<?php echo $currentPage;?>&show=1&guest_id=<?php echo $guestId;?>&enquiry_id=<?php echo $enquiry_id;?>&pid=<?php echo $proposalId;?>" style="text-decoration:none;" >Edit</a></li>
<li style="width:70px;text-align:left;"><a id="link" name="link" href="addguestinformation.php?enq=<?php echo $row['enq_id'];?>&pid=<?php echo $proposalId; ?>" style="text-decoration:none;" >Booking</a></li>
<!--<li style="width:70px;text-align:left;"><button id="bookingconfirm" name="bookingconfirm" class="button" type="button" onclick="bookingForm(<?php //echo $row['enq_id']?>);">Booking</button>-->
</ul>
答案 0 :(得分:0)
使用jQuery可以隐藏Element UL
$('ul').on('click',function(){ this.fadeout('slow');//when you click on Ul this will hide Ul });
to hide UL with attribute Id use
$('#hide').on('click',function(){ this.fadeOut('slow'); });
答案 1 :(得分:0)
与PHP单独使用你没有真正能够在没有重新加载页面的情况下做到这一点,现在这不是那么用户友好但是Jquery这是一个javascript库,可以为你做到这一点
//Gets the referance of the DOM Object by using the ID
$('#hideButton').click(function(e){
//prevents the default action of the button
e.preventDefault();
//Hides the list
$('#foo').fadeOut('slow', function(b){
//What to do once the list has faded out
alert('hidden');
});
});
Click Here用于工作的JSfiddle