微件:AnchorCore:修订间差异
来自Limbo Wiki
无编辑摘要 |
无编辑摘要 |
||
第9行: | 第9行: | ||
<script> | <script> | ||
(RLQ=window.RLQ||[]).push(function(){ | (RLQ=window.RLQ||[]).push(function(){ | ||
mw.loader.implement("lw.anchor",function($,jQuery | mw.loader.implement("lw.anchor",function($,jQuery){ | ||
$(".lw-AnchorError").ready(function(){ | $(".lw-AnchorError").ready(function(){ | ||
$(".lw-AnchorError").hide(); | $(".lw-AnchorError").hide(); | ||
第17行: | 第17行: | ||
$(".mw-parser-output a").click(function(){ | $(".mw-parser-output a").click(function(){ | ||
a = $(this).attr("href"); | a = $(this).attr("href"); | ||
if(a.substr(0,1) = "#"){ | if(a.substr(0,1) == "#"){ | ||
a = $(a); | a = $(a); | ||
if(a.length == 0){$("#Anchor-Default").show();} | if(a.length == 0){$("#Anchor-Default").show();} | ||
else{$("#Anchor-Default"). | else{$("#Anchor-Default").css("display","");} | ||
} | } | ||
}); | }); |
2022年8月27日 (六) 04:58的最新版本
<style> .lw-Anchor {
display:none;
} .lw-Anchor:target {
display:block;
} </style> <script> (RLQ=window.RLQ||[]).push(function(){ mw.loader.implement("lw.anchor",function($,jQuery){ $(".lw-AnchorError").ready(function(){ $(".lw-AnchorError").hide(); if(location.hash == ){$("#Anchor-Default").show();} });
$(".mw-parser-output a").click(function(){ a = $(this).attr("href"); if(a.substr(0,1) == "#"){ a = $(a); if(a.length == 0){$("#Anchor-Default").show();} else{$("#Anchor-Default").css("display","");} } }); }); });
</script>