国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

用jquery統(tǒng)計子菜單的條數(shù)示例代碼

2024-05-06 15:53:13
字體:
供稿:網(wǎng)友
統(tǒng)計子菜單條數(shù)的方法有很多,在本文為大家詳細(xì)介紹下使用jquery是如何實現(xiàn)的,感興趣的朋友不要錯過

用jquery統(tǒng)計子菜單的條數(shù)示例代碼

 
jquery tab特效~ (類似選項卡)

復(fù)制代碼 代碼如下:


<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tabs</title>
<style type="text/css">
/* Remove margin padding */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td { margin:0; padding:0; }

/* Default Font */
body,button,input,select,textarea { font:12px/1.5 /5b8b/4f53,arial,sans-serif; }
h1,h2,h3,h4,h5,h6 { font-size:100%; }
address,cite,dfn,em,var { font-style:normal; }
code,kbd,pre,samp { font-family:courier new,courier,monospace; }
small { font-size:12px; }
ul,ol { list-style:none; }
a { text-decoration:none; }
a:hover { text-decoration:underline; }
sup { vertical-align:text-top; }
sub { vertical-align:text-bottom; }
legend { color:#000; }
fieldset,img { border:0; }
button,input,select,textarea{ font-size:100%; }
table { border-collapse:collapse; border-spacing:0; }

.col-main{ float:left; width:100%; min-height:1px; }
.col-sub,.col-extra { float:left; }
.layout:after,.main-wrap:after,.col-sub:after,.col-extra:after { content:'/20'; display:block; height:0; clear:both; }
.layout,.main-wrap,.col-sub,.col-extra { zoom:1; }

/* Common Features */
.hidden { display:none; }
.invisible { visibility:hidden; }

/* Remove Float */
.clear { display:block; height:0; overflow:hidden; clear:both; }
.clearfix:after { content:'/20'; display:block; height:0; clear:both; }
.clearfix { *zoom:1; }

/* For non ie browsers also display the vertical scroll bar by default, to prevent the flicker caused by the scroll bar */
html { overflow-y:scroll; }

/* Default link styles */
a:link {color: #003399; }
a:visited {color: #123689;}
a:hover {color: #FF6600;}
</style>
</head>
<body>

<style type="text/css">
.menu { width:200px; border:1px solid #CCC; margin-bottom:20px }
.menu h3 { height:30px; line-height:30px; background:#ccc; }
.menu .num { font-weight:bold; color:red; padding-left:30px; }
</style>

<div>
<h3>系統(tǒng)設(shè)置 <span></span></h3>
<ul>
<li>菜單1</li>
<li>菜單2</li>
<li>菜單3</li>
<li>菜單4</li>
<li>菜單5</li>
<li>菜單6</li>
</ul>
</div>

<div>
<h3>菜單設(shè)置2 <span></span></h3>
<ul>
<li>菜單1</li>
<li>菜單2</li>
<li>菜單3</li>

</ul>
</div>

<div>
<h3>菜單設(shè)置3 <span></span></h3>
<ul>
<li>菜單1</li>
<li>菜單2</li>
<li>菜單3</li>
<li>菜單4</li>

<li>菜單5</li>
</ul>
</div>


<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
for ( var i=0; i<$('.menu').length; i++){
var num = $('.menu').eq(i).children('ul').children('li').length;
$('.menu').eq(i).find('.num').text(num);
}
</script>
</body>
</html>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 甘肃省| 锡林郭勒盟| 左贡县| 阳原县| 盐池县| 敦煌市| 玛纳斯县| 治县。| 平顶山市| 平乐县| 宾阳县| 亳州市| 榕江县| 临海市| 津南区| 建瓯市| 县级市| 宁远县| 江孜县| 会泽县| 和林格尔县| 沁源县| 鹰潭市| 滕州市| 汨罗市| 岱山县| 宜川县| 开江县| 集贤县| 邯郸县| 旬邑县| 扎赉特旗| 鲁山县| 武义县| 彭州市| 马关县| 丘北县| 富顺县| 沙坪坝区| 江北区| 铁岭县|