...
|
...
|
@@ -6,6 +6,8 @@ |
|
|
|
|
|
var $ = require('yoho.jquery');
|
|
|
|
|
|
var $returnTop = $('.return-top');
|
|
|
|
|
|
var apiDomain;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -126,6 +128,39 @@ function actionhomeFootChange() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
function rePosReturn() {
|
|
|
if ($(window).height() < $(document).height()) {
|
|
|
$returnTop.removeClass('hide');
|
|
|
} else {
|
|
|
$returnTop.addClass('hide');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//返回顶部
|
|
|
$returnTop.click(function() {
|
|
|
$('html,body').animate({
|
|
|
scrollTop: 0
|
|
|
}, 500);
|
|
|
});
|
|
|
|
|
|
$(window).scroll(function() {
|
|
|
if ($(window).scrollTop() === 0) {
|
|
|
$returnTop.addClass('hide');
|
|
|
} else {
|
|
|
$returnTop.removeClass('hide');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
rePosReturn();
|
|
|
|
|
|
//如果初始是隐藏的,监听图片加载,重新确定return-top的高度
|
|
|
if ($returnTop.hasClass('hide')) {
|
|
|
$('img').load(rePosReturn);
|
|
|
}
|
|
|
|
|
|
//初始化
|
|
|
actionSubscription();
|
|
|
actionhomeFootChange();
|
|
|
|
|
|
//暴露给有可能通AJAX改变内容的页面去用
|
|
|
window.rePosReturnTop = rePosReturn; |
...
|
...
|
|