jquery實現淡化以及消除

<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>
 <script type="text/javascript">
$(document).ready(function(){
  $("#test").click(function(){
  $(this).fadeOut(4000);
  });
});
</script>
</head>

<body>
<div id="test" style="background:yellow;width:200px">CLICK ME AWAY!</div>
<p>If you click on the box above, it will be removed.</p>
</body>

</html>
用fadeout(speed,callback);函數實現淡化消失,用fadeto(speed,callback);函數實現淡化到指定透明度

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章