最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實現(xiàn)的導(dǎo)航條切換可顯示隱藏

 更新時間:2014年10月22日 17:24:17   投稿:whsnow  
用jQuery實現(xiàn)一些導(dǎo)航條切換,顯示隱藏,主要用到slideToggle( ),toggeClass( ),toggle()

用jQuery實現(xiàn)一些導(dǎo)航條切換,顯示隱藏,主要運(yùn)用的技術(shù)有slideToggle( ),toggeClass( ),toggle( ):

代碼如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>導(dǎo)航條在項目中的應(yīng)用</title>
<script language="javascript" type="text/javascript" src="Jscript/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(".tit").find("span").click(function(){
$(this).toggleClass("closeBtn2").parent().next().slideToggle(); //實現(xiàn)內(nèi)容隱藏顯示,及圖標(biāo)的切換
}) ;
$(".clsBot").click(function(){
$(this).parent().find("li:gt(4)").toggle(); //實現(xiàn)內(nèi)容索引值大于4的隱藏或者顯示

})
})
</script>
<style type="text/css">
*{ margin: 0;padding: 0;}
ul li{ list-style: none;}
.box{ width: 400px; margin: 100px auto; border: 1px solid #ddd;}
.tit{ background: #999; height: 30px; color: #fff; font-size: 14px; line-height: 30px; padding-left: 6px; position: relative;}
.closeBtn{ background: url("Images/a2.gif") no-repeat 0 0; width: 7px; height: 8px; position: absolute; right: 10px; top: 10px; display: block; text-indent: -9999px; cursor: pointer;}
.closeBtn2{background: url("Images/a1.gif") no-repeat 0 0;}
.content{padding: 6px;font-size: 12px; overflow: hidden; }
.content li{ float: left; width: 100px; height: 24px; }
.content li a{ color: #999;}
.content li a:hover{ color: red;}
.clsBot{ display: block; clear: both; background: url("Images/a5.gif") no-repeat right 0; padding-right: 16px; float: right; width: 26px; cursor: pointer; color: blue;}
</style>
</head>
<body>
<div class="box">
<div class="tit">
<h2>圖書分類</h2>
<span class="closeBtn">關(guān)閉</span>
</div>
<div class="content">
<ul>
<li><a href="#">小說</a><i> ( 1110 ) </i></li>
<li><a href="#">文藝</a><i> ( 230 ) </i></li>
<li><a href="#">青春</a><i> ( 1430 ) </i></li>
<li><a href="#">少兒</a><i> ( 1560 ) </i></li>
<li><a href="#">生活</a><i> ( 870 ) </i></li>
<li><a href="#">社科</a><i> ( 1460 ) </i></li>
<li><a href="#">管理</a><i> ( 1450 ) </i></li>
<li><a href="#">計算機(jī)</a><i> ( 1780 ) </i></li>
<li><a href="#">教育</a><i> ( 930 ) </i></li>
<li><a href="#">工具書</a><i> ( 3450 ) </i></li>
<li><a href="#">引進(jìn)版</a><i> ( 980 ) </i></li>
<li><a href="#">其它類</a><i> ( 3230 ) </i></li>
</ul>
<span class="clsBot">簡化</span>
</div>
</div>
</body>
</html>

效果圖:

相關(guān)文章

最新評論

砚山县| 萝北县| 准格尔旗| 呼伦贝尔市| 佛学| 河南省| 西藏| 于田县| 罗甸县| 图片| 怀集县| 于都县| 福建省| 西贡区| 宁乡县| 钟祥市| 五常市| 蒲城县| 慈溪市| 德清县| 晋州市| 日照市| 漠河县| 崇州市| 九龙城区| 荣昌县| 库伦旗| 双桥区| 遵化市| 浦城县| 秦安县| 钟山县| 渭南市| 鄯善县| 正阳县| 莱州市| 西平县| 潍坊市| 茌平县| 孝昌县| 长海县|