Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
348d6a975bb5c739b38255616abad5f57e63117f
1 parent
80d01714
gulp ge文件提交
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
static/dist/myohobuy/1.3.6/index-debug.js
static/dist/myohobuy/1.3.6/index.js
static/dist/myohobuy/1.3.6/index-debug.js
View file @
348d6a9
...
...
@@ -1719,7 +1719,7 @@ function stopPropagation(e){
e
.
cancelBubble
=
false
;
}
function
innerScroll
(
e
){
/**
function innerScroll(e){
// 阻止冒泡到document
// document上已经preventDefault
stopPropagation(e);
...
...
@@ -1741,7 +1741,7 @@ function innerScroll(e){
}
// 会阻止原生滚动
// return false;
}
}
**/
var
disableScroll
=
function
(){
$
(
document
).
on
(
'mousewheel'
,
preventDefault
);
...
...
@@ -1760,8 +1760,9 @@ var enableScroll = function(){
enableScroll();
});**/
// 内部可滚
$sideNav
.
on
(
'mousewheel'
,
innerScroll
);
// 内部可滚
$sideNav
.
on
(
'touchmove mousewheel'
,
stopPropagation
);
// 外部禁用
disableScroll
();
...
...
@@ -1774,7 +1775,7 @@ $sideNav.on('touchstart', function(e){
});
// 仿innerScroll方法
$sideNav
.
on
(
'touchmove'
,
function
(
e
){
/**
$sideNav.on('touchmove', function(e){
e.stopPropagation();
var deltaX = e.originalEvent.touches[0].pageX - startX;
...
...
@@ -1802,7 +1803,7 @@ $sideNav.on('touchmove', function(e){
}
// 会阻止原生滚动
// return false;
});
});
**/
$
(
'.nav-btn'
).
on
(
'touchstart'
,
function
(
event
)
{
$sideNav
.
css
(
'pointer-events'
,
'none'
);
...
...
@@ -1814,10 +1815,10 @@ $('.nav-btn').on('touchstart', function(event) {
openSideNav
=
true
;
//设置boy高宽,页面不能上下滑动
$
(
'body'
).
css
({
/**
$('body').css({
height: $(window).height(),
overflow: 'hidden'
});
});
**/
setTimeout
(
function
()
{
$sideNav
.
css
(
'pointer-events'
,
'auto'
);
...
...
@@ -1833,10 +1834,10 @@ function hideSideBar() {
$
(
'.overlay'
).
hide
();
$
(
'.sub-nav'
).
removeClass
(
'show'
);
$sideNav
.
removeClass
(
'on'
);
$
(
'body'
).
css
({
/**
$('body').css({
height: 'auto',
overflow: 'auto'
});
});
**/
enableScroll
();
}
}
...
...
@@ -1861,7 +1862,7 @@ $sideNav.on('touchend', 'li', function(e) {
//返回一级导航,收起二级导航
$subNav
.
each
(
function
()
{
$
(
this
).
find
(
'li'
).
eq
(
0
).
on
(
'touch
start
'
,
function
()
{
$
(
this
).
find
(
'li'
).
eq
(
0
).
on
(
'touch
end
'
,
function
()
{
$
(
'.sub-nav'
).
removeClass
(
'show'
);
return
false
;
});
...
...
static/dist/myohobuy/1.3.6/index.js
View file @
348d6a9
This diff could not be displayed because it is too large.
Please
register
or
login
to post a comment