jQuery动画效果-slideUp slideDown上下滑动示例代码


复制代码 代码如下:

[code]
<html>
<head>
<meta charset="utf-8"/>
<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>
$(function(){
$("h5.head").hover(function(){
$("div.content").slideUp(3000);
},function(){
$("div.content").slideDown(3000);
});
})
</script>
</head>
<body>
<div id="container">
<h5 class="head">什么是jQuery?</h5>
<div class="content">
JQuery是继prototype原型之后又一个javascript库,他凭借简单的代码和完善的浏览器兼容性,再加上强大的DOM操作,完善的事件处理机制,强大的ajax操作,加大的简化了javascript开发人员的工作。
</div>
</div>
</body>
</html>

[/code]
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3