Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
e693aec6da07e5427d1834e115a8c75a6cfb8805
2 parents
16b04ea4
58641f81
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
static/js/guang/detail.js
static/js/guang/detail.js
View file @
e693aec
...
...
@@ -98,33 +98,14 @@ function thumbTouchEvt(e) {
myScroll
&&
myScroll
.
refresh
();
}
ellipsis
.
init
();
lazyLoad
(
$
(
'.lazy'
));
//title mlellipsis
$
(
'.info-list .title, .one-good .reco-name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
if
(
$authorIntro
.
offset
()
&&
(
parseInt
(
$authorIntro
.
offset
().
left
,
10
)
===
parseInt
(
$authorIntro
.
css
(
'margin-left'
),
10
)))
{
$authorIntro
.
css
(
'padding-top'
,
0
);
}
// 初始化iscroll
window
.
onload
=
function
()
{
function
initIscroll
()
{
var
$scroller
=
$
(
'#scroller'
),
$yohoHeader
=
$
(
'.yoho-header'
);
var
hH
=
0
,
winH
,
tcH
,
cbH
,
cbTop
,
fixedThumbDom
;
if
(
!
pageInIscroll
)
{
return
;
}
//考虑通用头部的影响:对offset().top以及winH做对应偏移
if
(
$yohoHeader
.
length
>
0
)
{
hH
=
$yohoHeader
.
outerHeight
();
...
...
@@ -193,15 +174,35 @@ window.onload = function() {
}
$scroller
.
trigger
(
'scroll'
);
});
}
//window onload 后重新refresh iscroll
window
.
onload
=
function
()
{
myScroll
&&
myScroll
.
refresh
();
};
//
是否使用iscro
ll初始化页面
//
初始化页面,包括是否使用iscor
ll初始化页面
//接口暴露在HTML中,使用压缩名
exports
.
i
=
function
(
useIscroll
)
{
var
isIphone
=
navigator
.
userAgent
.
indexOf
(
'iPhone'
)
>
0
?
true
:
false
;
pageInIscroll
=
isIphone
&&
useIscroll
;
ellipsis
.
init
();
lazyLoad
(
$
(
'.lazy'
));
//title mlellipsis
$
(
'.info-list .title, .one-good .reco-name'
).
each
(
function
()
{
this
.
mlellipsis
(
2
);
});
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
if
(
$authorIntro
.
offset
()
&&
(
parseInt
(
$authorIntro
.
offset
().
left
,
10
)
===
parseInt
(
$authorIntro
.
css
(
'margin-left'
),
10
)))
{
$authorIntro
.
css
(
'padding-top'
,
0
);
}
if
(
pageInIscroll
)
{
if
(
$
(
'.yoho-header'
).
length
>
0
)
{
$
(
'#wrapper'
).
addClass
(
'ios has-head'
);
...
...
@@ -237,6 +238,11 @@ exports.i = function(useIscroll) {
if
(
pageInIscroll
)
{
$fixedThumbContainer
.
delegate
(
'.thumb'
,
'touchend'
,
thumbTouchEvt
);
}
}
if
(
pageInIscroll
)
{
initIscroll
();
}
};
\ No newline at end of file
...
...
Please
register
or
login
to post a comment