...
|
...
|
@@ -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,8 @@ $('.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.offset() && (parseInt($authorIntro.offset().left, 10) ===
|
|
|
parseInt($authorIntro.css('margin-left'), 10))) {
|
|
|
$authorIntro.css('padding-top', 0);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -145,18 +147,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;
|
|
|
}
|
|
|
|
...
|
...
|
|