function getparams() {
var params = location.search.substring(1);
var Arrparams = params.split('&');
if(Arrparams.length ==2){
var mao = Arrparams[1].split('=')[1]
console.log(mao)
if(mao == "c1"){
$('.mestab>.mesleft>ul>li').eq(1).addClass('tabactive').siblings('li').removeClass('tabactive')
$('.mestab>.mesright> ul').eq(1).show().siblings('ul').hide()
}else if(mao == "c2"){
$('.mestab>.mesleft>ul>li').eq(2).addClass('tabactive').siblings('li').removeClass('tabactive')
$('.mestab>.mesright> ul').eq(2).show().siblings('ul').hide()
}
}else{
return
}
}
getparams();
通过url传参的方式,判断该参数是否符合
标签:jQuery,mestab,li,点点,ul,tabactive,siblings,eq,页面 From: https://www.cnblogs.com/dlx609/p/17602390.html