Gadget:oouiup.js:修订间差异

添加42字节 、​ 2023年7月30日 (星期日)
// Edit via Wikiplus
(// Edit via Wikiplus)
 
(// Edit via Wikiplus)
 
(未显示同一用户的6个中间版本)
$( 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,
var btn=btnObj.$element;
classes: [ 'backToTop' ]
btn.appendTo('body')
} );
if (scrollbarWidth === 0) {
$(window) btnObj.on("scroll" 'click', function () {
btn.css("right", "20px"); // 修复新版 Chrome 的自动隐藏式滚动条导致的按钮被覆盖 chrome://flags/#overlay-scrollbars
$( 'html, body' ).animate( {
}
scrollTop: 0
$(window).on("scroll", function() {
}, 120 );
$(document).scrollTop() > 0 ? btn.fadeIn() : btn.fadeOut();
}
}).scroll();
} );
var const $btn = btnObj.$element;
$btn.appendTo( 'body' );
if ( scrollbarWidth === 0 ) {
$btn.css( 'right', '20px' );
}
window.onscroll = function () {
if ( document.scrollingElement.scrollTop > 0 ) {
$btn.fadeIn();
} else {
$btn.fadeOut();
}
};
window.onscroll();
} );
维护员、​界面管理员、​巡查员、​监督员、​小部件编辑者
3,462

个编辑