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

JavaScript導(dǎo)航腳本判斷當(dāng)前導(dǎo)航

 更新時(shí)間:2016年07月12日 16:30:04   作者:zhaoyingyatou  
這篇文章主要介紹了JavaScript導(dǎo)航腳本判斷當(dāng)前導(dǎo)航的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

廢話不多說,直接給大家貼代碼了。

<script>
$(function () {
//highlight current / active link 左側(cè)導(dǎo)航判斷當(dāng)前活動(dòng)導(dǎo)航
$('ul.main-menu li a').each(function () {
var wo = window.location.href.substring(window.location.href.lastIndexOf('/') + 1, window.location.href.lastIndexOf('.'));
if ($(this).attr('href') == (wo + ".html")) {
$(this).parent().addClass('active');
$(this).parents().addClass('active');
$(this).parents('li').find("i:first").toggleClass("glyphicon-minus");
$(this).parents('ul').slideDown();
}else
if (("dxs" == wo || "syd" == wo)&&($(this).attr('href')=="dbs.html")) {
$(this).parent().addClass('active');
$(this).parents().addClass('active');
$(this).parents('li').find("i:first").toggleClass("glyphicon-minus");
$(this).parents('ul').slideDown();
}
});
/*** begin 主頁左側(cè)菜單 */ 
$(".main-menu a").click(function () {
//將當(dāng)前l(fā)i設(shè)置為活動(dòng)狀態(tài)
$(this).find("i:first").toggleClass("glyphicon-minus");
});
$(".main-menu a").click(function () {
//更換其他導(dǎo)航的加減號(hào)圖標(biāo)
$(this).parent('li').siblings(".active").find("i:first").toggleClass("glyphicon-minus");
//alert($(this).index());
//去掉其他導(dǎo)航的點(diǎn)擊樣式并折疊
$(this).parent('li').siblings(".active").removeClass("active").children("ul").slideUp('fast');
$(this).next('ul').slideToggle('fast');
$(this).parent('li').addClass('active');
});
/************** end 主頁左側(cè)菜單 */
})
</script>

以上所述是小編給大家介紹的JavaScript導(dǎo)航腳本判斷當(dāng)前導(dǎo)航,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

慈溪市| 南澳县| 山阳县| 香港| 温宿县| 汝阳县| 沙田区| 乌苏市| 黔西| 当阳市| 玉山县| 乌鲁木齐县| 双城市| 白山市| 子洲县| 肇庆市| 昌乐县| 政和县| 斗六市| 迁安市| 兴安县| 启东市| 克山县| 水城县| 莱州市| 阳谷县| 白银市| 大埔区| 宁都县| 连城县| 青海省| 毕节市| 高青县| 中西区| 深水埗区| 资溪县| 永胜县| 明光市| 洱源县| 外汇| 句容市|