You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
986 B
27 lines
986 B
$(function(){
|
|
// nav收缩展开
|
|
$('.nav-item>a').on('click',function(){
|
|
if (!$('.nav').hasClass('nav-mini')) {
|
|
if ($(this).next().css('display') == "none") {
|
|
//展开未展开
|
|
$('.nav-item').children('ul').slideUp(300);
|
|
$(this).next('ul').slideDown(300);
|
|
$(this).parent('li').addClass('nav-show').siblings('li').removeClass('nav-show');
|
|
}else{
|
|
//收缩已展开
|
|
$(this).next('ul').slideUp(300);
|
|
$('.nav-item.nav-show').removeClass('nav-show');
|
|
}
|
|
}
|
|
});
|
|
//nav-mini切换
|
|
$('#mini').on('click',function(){
|
|
if (!$('.nav').hasClass('nav-mini')) {
|
|
$('.nav-item.nav-show').removeClass('nav-show');
|
|
$('.nav-item').children('ul').removeAttr('style');
|
|
$('.nav').addClass('nav-mini');
|
|
}else{
|
|
$('.nav').removeClass('nav-mini');
|
|
}
|
|
});
|
|
}); |