jquery實現(xiàn)的下拉和收縮效果示例
更新時間:2014年08月21日 11:03:04 投稿:whsnow
下拉和收縮類似的效果應用非常的頻繁,這篇文章主要介紹了jquery實現(xiàn)的下拉和收縮效果,需要的朋友可以參考下
下拉和收縮類似的效果應用非常的頻繁,本章節(jié)簡單介紹一下如何實現(xiàn)此效果。
代碼實例如下:
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<head>
<title>螞蟻部落</title>
<style type="text/css">
body{
margin:0 auto;
padding:0;
width:570px;
font:75%/120% Arial, Helvetica, sans-serif;
}
a:focus{
outline:none;
}
#panel{
background:#69C7F7;
height:200px;
display:none;
}
.slide{
margin:0;
padding:0;
border-top:solid 4px #F27613;
}
.btn-slide{
background:#F27613 url(mytest/jQuery/20121225165932118.gif) no-repeat right -50px;
text-align:center;
width:144px;
height:31px;
padding:10px 10px 0 0;
margin:0 auto;
display:block;
font:bold 120%/100% Arial, Helvetica, sans-serif;
color:#fff;
text-decoration:none;
}
.active{
background-position:right 12px;
}
</style>
<script type="text/javascript" src="http://www.softwhy.com/mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#panel").slideToggle("slow");
$(this).toggleClass("active");
return false;
})
})
</script>
</head>
<body>
<div style="display: block;" id="panel"></div>
<p class="slide">
<a href="javascript:;" rel="external nofollow" class="btn-slide active">點擊查看效果</a>
</p>
</body>
</html>
以上代碼實現(xiàn)了下拉和收縮效果,代碼比較簡單,這里就不多介紹了。
您可能感興趣的文章:
相關文章
jquery獲取table中的某行全部td的內(nèi)容方法
jquery獲取table中的某行全部td的內(nèi)容方法,需要的朋友可以參考一下2013-03-03
JQuery Ajax WebService傳遞參數(shù)的簡單實例
下面小編就為大家?guī)硪黄狫Query Ajax WebService傳遞參數(shù)的簡單實例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-11-11
ASP.NET jQuery 實例4(復制TextBox的文本到本地剪貼板上)
在這節(jié),我們將看到如何把多行文本框的內(nèi)容復制到剪貼板上。注意:jQuery clipboard plugin 只支持IE2012-01-01

