3,462
个编辑
MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针。
如果在编辑的过程中遇到了什么问题,可以去讨论板提问。
为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证。
MCBBS Wiki GitHub群组已上线!
您可以在回声洞中发表吐槽!
服务器状态监控。点击进入
本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>
(// Edit via Wikiplus) |
(// Edit via Wikiplus) |
||
(未显示同一用户的6个中间版本) | |||
$( function () {
if($(".backToTop").length > 0) { // 已经加载了仿论坛版本
switch ("scroll") {▼
return;
case getComputedStyle(body).overflowY:▼
}
scrollbarWidth = innerWidth - body.clientWidth;▼
default:▼
scrollbarWidth = innerWidth - html.clientWidth;
break;
body.style.overflowY = "scroll";▼
▲ scrollbarWidth = innerWidth - body.clientWidth;
const backup
var btnObj = new OO.ui.ButtonWidget({▼
body.style.overflowY = backup;
icon: 'collapse',▼
}
invisibleLabel: true,▼
label: '返回顶部',
classes: ['backToTop']▼
title: '返回顶部',
})▼
var btn=btnObj.$element;▼
btn.appendTo('body')▼
} );
if (scrollbarWidth === 0) {▼
$( 'html, body' ).animate( {
scrollTop: 0
▲ $(window).on("scroll", function() {
}, 120 );
}
▲ $btn.appendTo( 'body' );
$btn.css( 'right', '20px' );
}
window.onscroll = function () {
if ( document.scrollingElement.scrollTop > 0 ) {
$btn.fadeIn();
} else {
$btn.fadeOut();
}
};
window.onscroll();
▲} );
|