跳转到内容

User:Zhangjintao/vector.js

维基百科,自由的百科全书

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

/*
   本工具會在畫面左下角加設跳至頁頂和頁底的常駐連結。
*/
 
mw.loader.using('ext.gadget.site-lib', function(){
	$(function(){
		var i=0, hash="bodybottom";
		while($('[name='+hash+i+']').length+$('#'+hash+i).length!=0) ++i;
 
		$("body")
		.append(
			$('<div class="noprint" style="clear: both; height: 2em;" />')
			.append('<a name="'+hash+i+'" id="'+hash+i+'" style="font-size: 1pt;">&nbsp;</a>')
		)
		.append(
			$('<div class="toccolours noprint" style="position: fixed; width: auto; left: 0px; bottom: 0px; font-size: small;" />')
			.append('<a href="#">↑'+wgULS('页顶', '頁頂')+'</a>')
			.append('|')
			.append('<a href="#'+hash+i+'">'+wgULS('页', '頁')+'底↓</a>')
			.css("z-index", $("*").length)
		);
	});
});