//返回顶部按钮显示隐藏
var scrollToTopBox = document.getElementById('backTop');
window.addEventListener('scroll', function(e) {
if (window.pageYOffset >= 300){
scrollToTopBox.style.display="block";
}else if(window.pageYOffset <300){
scrollToTopBox.style.display="none";
}
});
返回顶部
scrollToTopBox.addEventListener('tap',function(e){
window.scrollTo(0, 0, 100);
})