|
|
| 第169行: |
第169行: |
| if (this.parentElement.childNodes[0] === this) { $(this).addClass("listInRef"); } | | if (this.parentElement.childNodes[0] === this) { $(this).addClass("listInRef"); } |
| }); | | }); |
| //列表侧边距
| |
| setInterval(function() {
| |
| $(".mw-parser-output ul, .mw-parser-output ol").not(".margin-left-set").each(function() {
| |
| if (/none.+none/i.test($(this).css("list-style")) || $(this).is(".gallery")) {
| |
| if ($(this).parent().is("li") && $(this).parent().parent().is("ul,ol")) { $(this).css("margin-left", "1.2em"); } else { $(this).css("margin-left", "0.2em"); }
| |
| } else if ($(this).is("ol")) {
| |
| var l = $(this).children("li").length;
| |
| if ($(this).attr("start")) { l += parseInt($(this).attr("start")); }
| |
| $(this).css("margin-left", (l + "").length * 0.5 + 1.2 + "em");
| |
| } else { $(this).css("margin-left", "1.2em"); }
| |
| $(this).addClass("margin-left-set");
| |
| });
| |
| }, 200);
| |
| //修正hash跳转错误 | | //修正hash跳转错误 |
| if ($(".mw-collapsible")[0]) { | | if ($(".mw-collapsible")[0]) { |