注意:在您儲存之後您必須清除瀏覽器快取才可看到最新的變動。
?_=1
來訪問最新頁面。
/**
* -------------------------------------------------------------------------
* !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
* -------------------------------------------------------------------------
*/
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/LetYouDown/Gadget-LetYouDown.js|user=[[U:AnnAngela]]|co-authors=GH:github-actions[bot]|longId=103d1a563ea4ccc8ff29fb55c9bcd88329a56eb5|shortId=103d1a56|summary=feat: rename (#594)|body=<nowiki>Co-authored-by: github-actions[bot] <41898282+github-actions[bot]📧users.noreply.github.com></nowiki>}}';
/* <pre> */
"use strict";
$(function () {
var container = $("#mw-content-text");
var getScrollTop = function () {
var headings = $("#mw-content-text .mw-parser-output > :is(h1, h2)");
return (headings.length >= 3 ? headings.last().offset().top : container.offset().top + container.outerHeight()) - 20;
};
var scrollTop = getScrollTop();
setInterval(function () {
scrollTop = getScrollTop();
}, 7130);
var btn = insertToBottomRightCorner("跳到底部").attr({
title: "跳到底部",
id: "LetYouDown"
}).css({
"user-select": "none",
transition: "opacity .13s ease-in-out",
order: "999"
}).on("click", function () {
$("html, body").animate({
scrollTop: scrollTop
}, 130);
});
var $document = $(document);
$(window).on("resize", function () {
scrollTop = getScrollTop();
}).on("scroll", function () {
btn.css("opacity", $document.scrollTop() < scrollTop ? ".6" : "0");
}).trigger("scroll");
});
/* </pre> */