首页 > 代码库 > JQ动画,背景透明度
JQ动画,背景透明度
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script src="http://www.mamicode.com/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type ="text/javascript" >
$(function() {
$("#panel").toggle(function() {
$(this).fadeOut();
}, function() {
$(this ).fadeIn ();
});
});
$(function() {
$("#btnShow").click(function() {
$("#panel").fadeIn();
});
$("#btnHide").click(function() {
$("#panel").fadeOut();
});
//***************************
$("#btnSlideup").click(function() {
$("#div1").slideUp();
});
$("#btnslideDown").click(function() {
$("#div1").slideDown ();
});
});
</script>
</head>
<body>
<div id ="panel">sdfsldfjlksjalkfjdlsakjflksjadlfkjasldkjflksdaf</div>
<input type ="button" value ="http://www.mamicode.com/透明度显示" id ="btnShow"/>
<input type ="button" value ="http://www.mamicode.com/透明度隐藏" id ="btnHide"/>
<br />
<div id ="div1" >阿来的快放假了卡斯的减肥拉开斯蒂芬</div>
<input type ="button" value ="http://www.mamicode.com/垂直显示" id ="btnSlideup"/>
<input type ="button" value ="http://www.mamicode.com/垂直隐藏" id ="btnslideDown"/>
</body>
</html>