打开主菜单
首页
随机
最近更改
特殊页面
设置
关于珠海交通维基
免责声明
珠海交通维基
搜索
更改
←上一编辑
下一编辑→
MediaWiki:Common.js
(查看源代码)
2022年10月16日 (日) 01:35的版本
添加178字节
、
2022年10月16日 (日) 01:35
无编辑摘要
第53行:
第53行:
var txt = " ",
var txt = " ",
btn = $('<div/>', {
btn = $('<div/>', {
−
"
text
"
:
"
返回顶部
"
,
+
'
text
'
: 返回顶部,
−
"
attr
"
: {
+
'
attr
'
: {
−
"
title
"
:
"
返回顶部
"
,
+
'
title
'
: 返回顶部,
−
"
class
"
:
"
backToTop
"
+
'
class
'
:
'
backToTop
'
−
},
+
},
'css': {
'css': {
'user-select': 'none'
'user-select': 'none'
第69行:
第69行:
}
}
}).appendTo(document.body);
}).appendTo(document.body);
−
$(window).on('scroll', function() {
+
var fadeOutTimeout;
−
$(document).scrollTop()
>
0
?
btn.fadeIn()
:
btn.fadeOut();
+
$(window).on('scroll', function() {
−
}).scroll();
+
if (
$(document).scrollTop()
==
0
) {
+
btn.fadeOut();
+
} else {
+
clearTimeout(fadeOutTimeout);
+
btn.fadeIn()
;
+
fadeOutTimeout = setTimeout( function(){
btn.fadeOut(
); }, 2333
);
+
}
+
}).scroll();
});
});
田所浩不二
机器人
、
界面管理员
、
管理员
3,662
个编辑