Showing
1 changed file
with
17 additions
and
7 deletions
@@ -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 { |
@@ -145,18 +146,27 @@ if (hasCollocationBlock) { | @@ -145,18 +146,27 @@ if (hasCollocationBlock) { | ||
145 | 146 | ||
146 | $thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); | 147 | $thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); |
147 | 148 | ||
148 | - if (isIphone) { | 149 | + if (isIphone && !isEzinPage) { |
149 | $fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); | 150 | $fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); |
150 | } | 151 | } |
151 | } | 152 | } |
152 | 153 | ||
154 | +/** | ||
155 | + * 初始化页面参数 | ||
156 | + */ | ||
157 | +exports.init = function (flag) { | ||
158 | + if (flag === true) { | ||
159 | + isEzinPage = true; | ||
160 | + } | ||
161 | +}; | ||
162 | + | ||
153 | // 初始化iscroll | 163 | // 初始化iscroll |
154 | window.onload = function() { | 164 | window.onload = function() { |
155 | var $scroller = $('#scroller'); | 165 | var $scroller = $('#scroller'); |
156 | 166 | ||
157 | var winH, tcH, cbH, cbTop, fixedThumbDom; | 167 | var winH, tcH, cbH, cbTop, fixedThumbDom; |
158 | 168 | ||
159 | - if (!isIphone) { | 169 | + if (!isIphone || isEzinPage) { |
160 | return; | 170 | return; |
161 | } | 171 | } |
162 | 172 |
-
Please register or login to post a comment