Gadget:oouiup.js:修订间差异

删除105字节 、​ 2023年7月30日 (星期日)
// Edit via Wikiplus
(// Edit via Wikiplus)
(// Edit via Wikiplus)
 
(未显示同一用户的5个中间版本)
$( function () {
var const body = document.body,
html = document.documentElement;
var const innerWidth = window.innerWidth;
var scrollbarWidth;
if($(".backToTop").length > 0) { // 已经加载了仿论坛版本
switch ("scroll") {
return;
case getComputedStyle(body).overflowY:
}
scrollbarWidth = innerWidth - body.clientWidth;
switch (" 'scroll"' ) {
break;
case getComputedStyle(html body ).overflowY:
scrollbarWidth = innerWidth - htmlbody.clientWidth;
break;
case getComputedStyle(body html ).overflowY:
default:
scrollbarWidth = innerWidth - html.clientWidth;
var backup = body.style.overflowY;
break;
body.style.overflowY = "scroll";
default:
scrollbarWidth = innerWidth - body.clientWidth;
const backup = body.style.overflowY = backup;
body.style.overflowY = "'scroll"';
}
scrollbarWidth = innerWidth - body.clientWidth;
var btnObj = new OO.ui.ButtonWidget({
body.style.overflowY = backup;
icon: 'collapse',
}
label: "ABC",
var const btnObj = new OO.ui.ButtonWidget( {
title: "TIT",
icon: 'collapse',
invisibleLabel: true,
label: '返回顶部',
classes: ['backToTop']
title: '返回顶部',
})
invisibleLabel: true,
btnObj.on("click",function() {
classes: [ 'backToTop' ]
$("html, body").animate({
} );
scrollTop: 0
btnObj.on(" 'click"', function () {
}, 120);
$(" 'html, body"' ).animate( {
}
scrollTop: 0
)
}, 120 );
var btn=btnObj.$element;
}
btn.appendTo('body')
);
if (scrollbarWidth === 0) {
var const $btn = btnObj.$element;
btn.css("right", "20px"); // 修复新版 Chrome 的自动隐藏式滚动条导致的按钮被覆盖 chrome://flags/#overlay-scrollbars
$btn.appendTo( 'body' );
}
if ( scrollbarWidth === 0 ) {
$(window).on("scroll", function() {
$btn.css( 'right', '20px' );
$(document).scrollTop() > 0 ? btn.fadeIn() : btn.fadeOut();
}
}).scroll();
$( window).on("scroll",onscroll = function () {
});
if ( document.scrollingElement.scrollTop > 0 ) {
$btn.fadeIn();
} else {
$btn.fadeOut();
}
};
window.onscroll();
} );
维护员、​界面管理员、​巡查员、​监督员、​小部件编辑者
3,462

个编辑