Authored by ccbikai

侧边栏点击穿透

... ... @@ -45,6 +45,7 @@ navHammer.on('tap', function(event) {
});
event.srcEvent.stopPropagation();
return false;
});
mobileWrapHammer = new Hammer($('.mobile-wrap')[0]);
... ... @@ -62,11 +63,12 @@ mobileWrapHammer.on('tap', function(e) {
$('.overlay').hide();
}, 300);
e.srcEvent.stopPropagation();
return false;
}
});
//点击一级导航,弹出二级导航
$sideNav.on('touchstart', 'li', function () {
$sideNav.on('touchend', 'li', function () {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
... ... @@ -75,10 +77,12 @@ $sideNav.on('touchstart', 'li', function () {
//返回一级导航,收起二级导航
$('.sub-nav').each(function () {
$(this).find('li').eq(0).on('touchstart', function (e) {
$(this).find('li').eq(0).on('touchend', function (e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
return false;
});
}).on('touchend', function() {
$('.sub-nav').find('li').removeClass('current');
});
//头部banner轮播
... ...
... ... @@ -110,12 +110,12 @@
}
.sub-nav {
// display: none;
display: none;
position: fixed;
bottom: 0;
top: 0;
right: 100rem / $pxConvertRem;
left: 0;
bottom: 0;
// right: 100rem / $pxConvertRem;
width: 100%;
background: #fff !important;
// z-index: 2;
... ... @@ -185,7 +185,7 @@
}
.sub-nav.show {
display: block;
@include transform(translateX(0));
@include transition(transform 0.3s);
}
\ No newline at end of file
... ...