fadeIn()通过不透明的变化来实现所有匹配元素淡入的效果
fadeout()淡出
fadeTo()渐进
<style>
*{ margin:0; padding:0;}
body{font-size:15px;}
#container{ margin:60px; line-height:2em; width:300px; border:1px solid #CCC;}
.head{ background:#999; padding:5px; cursor:pointer;}
.content{ text-indent:15px;}
</style>
<script type="text/javascript" src="../script/jquery-1.4.2.min.js"></script>
<script>
//fadeIn()淡入,fadeout()淡出
$(function(){
$("h5.head").toggle(function(){
$("div.content").fadeOut(5000);
},function(){
$("div.content").fadeIn("fast")
});
})
</script>
</head>
<body>
<div id="container">
<h5 class="head">什么是jQuery?</h5>
<div class="content">
JQuery是继prototype原型之后又一个javascript库,他凭借简单的代码和完善的浏览器兼容性,再加上强大的DOM操作,完善的事件处理机制,强大的ajax操作,加大的简化了javascript开发人员的工作。
</div>
</div>