...
|
...
|
@@ -446,21 +446,40 @@ define('yohood', function(require, exports) { |
|
|
});
|
|
|
|
|
|
//侧栏相关推荐位置
|
|
|
relatedTop = $('.side-related-post').offset().top;
|
|
|
relatedPost = $('.side-related-post');
|
|
|
relatedTop = relatedTop.offset().top;
|
|
|
if (navigator.userAgent.indexOf('iPad') === -1) {
|
|
|
$(window).on('scroll', function() {
|
|
|
relatedTop = $('.app-download').offset().top + $('.app-download').outerHeight();
|
|
|
if (relatedTop <= $(this).scrollTop()) {
|
|
|
$('.side-related-post').css({
|
|
|
/*$('.side-related-post').css({
|
|
|
"position": "fixed",
|
|
|
"top": "0",
|
|
|
"left": "50%",
|
|
|
"width": "280px",
|
|
|
"marginLeft": "210px"
|
|
|
})
|
|
|
})*/
|
|
|
detailBodyOffsetTop = $('.detail-body').offset().top;
|
|
|
detailBodyHeight = $('.detail-body').outerHeight();
|
|
|
relatedPostsOffsetHeightTop = relatedPost.offset().top + relatedPost.outerHeight();
|
|
|
distance = detailBodyHeight + detailBodyOffsetTop;
|
|
|
eleTop = distance - relatedPost.outerHeight();
|
|
|
if (relatedPostsOffsetHeightTop >= distance) {
|
|
|
relatedPost.css({
|
|
|
'position': 'absolute',
|
|
|
'top': eleTop - relatedPostsTop
|
|
|
});
|
|
|
}
|
|
|
if (relatedPost.offset().top - $(window).scrollTop() > relatedPostsTop) {
|
|
|
relatedPost.css({
|
|
|
'position': 'fixed',
|
|
|
'top': relatedPostsTop
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
$('.side-related-post').removeAttr('style');
|
|
|
}
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|