欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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à)值,需要的朋友可以參考下

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

<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 主頁(yè)左側(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 主頁(yè)左側(cè)菜單 */
})
</script>

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

相關(guān)文章

最新評(píng)論