jquery实现点击向下滑动,再点向上滑动收回
更新:HHH   时间:2023-1-7


<html>
<head>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs
/jquery/1.4.0/jquery.min.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
  $(".flip").click(function(){
    $(".panel").slideToggle(5000);
  });
});
</script>
 
<style type="text/css">
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
}
div.panel
{
height:120px;
display:none;
}
</style>
</head>
 
<body>
 
<div class="panel">
<p>Because time is valuable, we deliver quick and easy learning.</p>
<p>At W3School, you can study everything you need to learn, in an accessible and handy format.</p>
</div>
 
<p class="flip">Show Panel</p>
 
</body>
</html>
 

返回web开发教程...