Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHO-ACTIVITY-PHP
·
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
hf
9 years ago
Commit
6dd0fc8fbcab76d2b96684928110740c0b1d9cc0
2 parents
f4006dec
32a19a6e
Merge remote-tracking branch 'origin/develop'
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
static/js/guang/detail.js
static/js/guang/info.js
static/js/guang/detail.js
View file @
6dd0fc8
...
...
@@ -11,7 +11,8 @@ var $ = require('jquery'),
var
$authorIntro
=
$
(
'.author .intro'
);
var
isIphone
=
navigator
.
userAgent
.
indexOf
(
'iPhone'
)
>
0
?
true
:
false
;
var
isEzinPage
=
false
,
isIphone
=
navigator
.
userAgent
.
indexOf
(
'iPhone'
)
>
0
?
true
:
false
;
var
hasCollocationBlock
=
$
(
'.collocation-block'
).
length
>
0
?
true
:
false
;
...
...
@@ -41,7 +42,7 @@ function posCollocationArrow($curCo) {
backgroundPosition
:
bgPos
+
' bottom'
});
if
(
isIphone
)
{
if
(
isIphone
&&
!
isEzinPage
)
{
$fixedThumbContainer
.
css
({
backgroundPosition
:
bgPos
+
' bottom'
});
...
...
@@ -61,7 +62,7 @@ function thumbTouchEvt(e) {
$thumbs
.
filter
(
'.focus'
).
removeClass
(
'focus'
);
if
(
isIphone
)
{
if
(
isIphone
&&
!
isEzinPage
)
{
if
(
$curCo
.
closest
(
'.fixed-thumb-container'
).
length
>
0
)
{
$brother
=
$thumbContainer
;
}
else
{
...
...
@@ -85,7 +86,7 @@ function thumbTouchEvt(e) {
//
lazyLoad
(
$curProds
.
find
(
'.lazy'
));
if
(
isIphone
)
{
if
(
isIphone
&&
!
isEzinPage
)
{
if
(
myScroll
)
{
myScroll
.
scrollToElement
(
scrollToEl
,
400
);
}
...
...
@@ -98,7 +99,7 @@ function thumbTouchEvt(e) {
myScroll
&&
myScroll
.
refresh
();
}
if
(
isIphone
)
{
if
(
isIphone
&&
!
isEzinPage
)
{
if
(
$
(
'.yoho-header'
).
length
>
0
)
{
$
(
'#wrapper'
).
addClass
(
'ios has-head'
);
}
else
{
...
...
@@ -116,7 +117,7 @@ $('.info-list .title, .one-good .reco-name').each(function() {
});
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
if
(
parseInt
(
$authorIntro
.
offset
().
left
,
10
)
===
parseInt
(
$authorIntro
.
css
(
'margin-left'
),
10
))
{
if
(
$authorIntro
&&
parseInt
(
$authorIntro
.
offset
().
left
,
10
)
===
parseInt
(
$authorIntro
.
css
(
'margin-left'
),
10
))
{
$authorIntro
.
css
(
'padding-top'
,
0
);
}
...
...
@@ -145,18 +146,27 @@ if (hasCollocationBlock) {
$thumbContainer
.
delegate
(
'.thumb'
,
'touchend'
,
thumbTouchEvt
);
if
(
isIphone
)
{
if
(
isIphone
&&
!
isEzinPage
)
{
$fixedThumbContainer
.
delegate
(
'.thumb'
,
'touchend'
,
thumbTouchEvt
);
}
}
/**
* 初始化页面参数
*/
exports
.
init
=
function
(
flag
)
{
if
(
flag
===
true
)
{
isEzinPage
=
true
;
}
};
// 初始化iscroll
window
.
onload
=
function
()
{
var
$scroller
=
$
(
'#scroller'
);
var
winH
,
tcH
,
cbH
,
cbTop
,
fixedThumbDom
;
if
(
!
isIphone
)
{
if
(
!
isIphone
||
isEzinPage
)
{
return
;
}
...
...
static/js/guang/info.js
View file @
6dd0fc8
...
...
@@ -47,7 +47,13 @@ function setLazyLoadAndMellipsis($infos) {
* @params $container 逛资讯列表容器
*/
function
initInfosEvt
(
$container
)
{
var
cHammer
=
new
Hammer
(
$container
[
0
]);
var
cHammer
;
if
(
typeof
$container
===
'undefined'
)
{
return
;
}
cHammer
=
new
Hammer
(
$container
[
0
]);
cHammer
.
on
(
'tap'
,
function
(
e
)
{
var
$this
=
$
(
e
.
target
),
...
...
Please
register
or
login
to post a comment