移动端点击页内目录外区域折叠页内目录
This commit is contained in:
parent
f6de137157
commit
5de3ed9152
|
|
@ -161,7 +161,7 @@ footer .signature{position:absolute;right:40px;bottom:17px;color:#999;}
|
|||
.container{position:relative;margin:50px auto 0;overflow:hidden;background:#fff;border:none;}
|
||||
|
||||
/* ---------- menu ---------- */
|
||||
.container .nav{display:none;position:fixed;left:0;top:50px;z-index:9999;width:100%;height:100%;padding-bottom:30px;background:rgba(0,0,0,0.8);overflow-y:scroll;}
|
||||
.container .nav{display:none;position:fixed;left:0;top:50px;z-index:9999;width:100%;height:100%;padding-bottom:30px;background:rgba(0,0,0,0.92);overflow-y:scroll;}
|
||||
.container .nav.on{display:block;}
|
||||
.menu-filter{width:100%;padding-right:39px;background-color:none;box-sizing:border-box;}
|
||||
.menu-filter input{width:90%;width:-webkit-calc(100% - 39px);width:-moz-calc(100% - 39px);width:-ms-calc(100% - 39px);width:calc(100% - 39px);color:#fff;background:none;border:none;border-bottom:#999 1px dashed;}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,17 @@ $(function () {
|
|||
$filterClean = $filter.next('i'),
|
||||
$contents = $('#contents');
|
||||
|
||||
//是否为移动端
|
||||
var isMobi = (function () {
|
||||
var winW = $win.width();
|
||||
$win.on('resize', function () {
|
||||
winW = $win.width();
|
||||
});
|
||||
return function () {
|
||||
return winW <= 720;
|
||||
};
|
||||
})();
|
||||
|
||||
//页面基本显示与操作
|
||||
(function () {
|
||||
//菜单折叠
|
||||
|
|
@ -147,12 +158,22 @@ $(function () {
|
|||
$contents.children('.btn').on('click', function (e) {
|
||||
$contents.toggleClass('on').removeClass('hover');
|
||||
});
|
||||
$contents.hover(function(){
|
||||
$contents.hover(function () {
|
||||
$contents.addClass('hover');
|
||||
},function(){
|
||||
}, function () {
|
||||
$contents.removeClass('hover');
|
||||
});
|
||||
|
||||
//全局点击
|
||||
$(document).on('click', function (e) {
|
||||
var $tag = $(e.target);
|
||||
//移动端
|
||||
if (isMobi()) {
|
||||
//折叠目录悬浮窗
|
||||
if ($tag.closest('#contents').length == 0) {
|
||||
$contents.removeClass('on').removeClass('on');
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue