Authored by xuqi

supplement deleted function when operate conficts

... ... @@ -101,7 +101,8 @@ gulp.task('compass-production', ['assets'], function() {
image: distDir.img,
font: distDir.font,
http_path: '/',
style: 'compressed'
style: 'compressed',
sourcemap: false
})
)
.on('error', function(error) {
... ... @@ -166,7 +167,7 @@ gulp.task('concat-min-libs', ['pre-libs'], function() {
fs.writeFileSync(path, jsStr.substr(jsStr.indexOf('});') + 4));
return gulp.src(['js/sea.js', distDir.js + '/libs.js'])
return gulp.src(['plugin/sea.js', distDir.js + '/libs.js'])
.pipe(concat('lib.js'))
.pipe(uglify())
.pipe(gulp.dest(distDir.js));
... ...
... ... @@ -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;
\ No newline at end of file
... ...