|
@@ -11,7 +11,8 @@ var $ = require('jquery'), |
|
@@ -11,7 +11,8 @@ var $ = require('jquery'), |
11
|
|
11
|
|
12
|
var $authorIntro = $('.author .intro');
|
12
|
var $authorIntro = $('.author .intro');
|
13
|
|
13
|
|
14
|
-var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
|
14
|
+var isEzinPage = false,
|
|
|
15
|
+ isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
|
15
|
|
16
|
|
16
|
var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false;
|
17
|
var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false;
|
17
|
|
18
|
|
|
@@ -41,7 +42,7 @@ function posCollocationArrow($curCo) { |
|
@@ -41,7 +42,7 @@ function posCollocationArrow($curCo) { |
41
|
backgroundPosition: bgPos + ' bottom'
|
42
|
backgroundPosition: bgPos + ' bottom'
|
42
|
});
|
43
|
});
|
43
|
|
44
|
|
44
|
- if (isIphone) {
|
45
|
+ if (isIphone && !isEzinPage) {
|
45
|
$fixedThumbContainer.css({
|
46
|
$fixedThumbContainer.css({
|
46
|
backgroundPosition: bgPos + ' bottom'
|
47
|
backgroundPosition: bgPos + ' bottom'
|
47
|
});
|
48
|
});
|
|
@@ -61,7 +62,7 @@ function thumbTouchEvt(e) { |
|
@@ -61,7 +62,7 @@ function thumbTouchEvt(e) { |
61
|
|
62
|
|
62
|
$thumbs.filter('.focus').removeClass('focus');
|
63
|
$thumbs.filter('.focus').removeClass('focus');
|
63
|
|
64
|
|
64
|
- if (isIphone) {
|
65
|
+ if (isIphone && !isEzinPage) {
|
65
|
if ($curCo.closest('.fixed-thumb-container').length > 0) {
|
66
|
if ($curCo.closest('.fixed-thumb-container').length > 0) {
|
66
|
$brother = $thumbContainer;
|
67
|
$brother = $thumbContainer;
|
67
|
} else {
|
68
|
} else {
|
|
@@ -85,7 +86,7 @@ function thumbTouchEvt(e) { |
|
@@ -85,7 +86,7 @@ function thumbTouchEvt(e) { |
85
|
//
|
86
|
//
|
86
|
lazyLoad($curProds.find('.lazy'));
|
87
|
lazyLoad($curProds.find('.lazy'));
|
87
|
|
88
|
|
88
|
- if (isIphone) {
|
89
|
+ if (isIphone && !isEzinPage) {
|
89
|
if (myScroll) {
|
90
|
if (myScroll) {
|
90
|
myScroll.scrollToElement(scrollToEl, 400);
|
91
|
myScroll.scrollToElement(scrollToEl, 400);
|
91
|
}
|
92
|
}
|
|
@@ -98,7 +99,7 @@ function thumbTouchEvt(e) { |
|
@@ -98,7 +99,7 @@ function thumbTouchEvt(e) { |
98
|
myScroll && myScroll.refresh();
|
99
|
myScroll && myScroll.refresh();
|
99
|
}
|
100
|
}
|
100
|
|
101
|
|
101
|
-if (isIphone) {
|
102
|
+if (isIphone && !isEzinPage) {
|
102
|
if ($('.yoho-header').length > 0) {
|
103
|
if ($('.yoho-header').length > 0) {
|
103
|
$('#wrapper').addClass('ios has-head');
|
104
|
$('#wrapper').addClass('ios has-head');
|
104
|
} else {
|
105
|
} else {
|
|
@@ -116,7 +117,8 @@ $('.info-list .title, .one-good .reco-name').each(function() { |
|
@@ -116,7 +117,8 @@ $('.info-list .title, .one-good .reco-name').each(function() { |
116
|
});
|
117
|
});
|
117
|
|
118
|
|
118
|
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
|
119
|
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
|
119
|
-if (parseInt($authorIntro.offset().left, 10) === parseInt($authorIntro.css('margin-left'), 10)) {
|
120
|
+if ($authorIntro.offset() && (parseInt($authorIntro.offset().left, 10) ===
|
|
|
121
|
+ parseInt($authorIntro.css('margin-left'), 10))) {
|
120
|
$authorIntro.css('padding-top', 0);
|
122
|
$authorIntro.css('padding-top', 0);
|
121
|
}
|
123
|
}
|
122
|
|
124
|
|
|
@@ -145,18 +147,27 @@ if (hasCollocationBlock) { |
|
@@ -145,18 +147,27 @@ if (hasCollocationBlock) { |
145
|
|
147
|
|
146
|
$thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
|
148
|
$thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
|
147
|
|
149
|
|
148
|
- if (isIphone) {
|
150
|
+ if (isIphone && !isEzinPage) {
|
149
|
$fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
|
151
|
$fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
|
150
|
}
|
152
|
}
|
151
|
}
|
153
|
}
|
152
|
|
154
|
|
|
|
155
|
+/**
|
|
|
156
|
+ * 初始化页面参数
|
|
|
157
|
+ */
|
|
|
158
|
+exports.init = function (flag) {
|
|
|
159
|
+ if (flag === true) {
|
|
|
160
|
+ isEzinPage = true;
|
|
|
161
|
+ }
|
|
|
162
|
+};
|
|
|
163
|
+
|
153
|
// 初始化iscroll
|
164
|
// 初始化iscroll
|
154
|
window.onload = function() {
|
165
|
window.onload = function() {
|
155
|
var $scroller = $('#scroller');
|
166
|
var $scroller = $('#scroller');
|
156
|
|
167
|
|
157
|
var winH, tcH, cbH, cbTop, fixedThumbDom;
|
168
|
var winH, tcH, cbH, cbTop, fixedThumbDom;
|
158
|
|
169
|
|
159
|
- if (!isIphone) {
|
170
|
+ if (!isIphone || isEzinPage) {
|
160
|
return;
|
171
|
return;
|
161
|
}
|
172
|
}
|
162
|
|
173
|
|