打开主菜单
首页
随机
最近更改
特殊页面
设置
关于珠海交通维基
免责声明
珠海交通维基
搜索
更改
←上一编辑
下一编辑→
MediaWiki:Common.js
(查看源代码)
2021年2月5日 (五) 08:44的版本
添加1,411字节
、
2021年2月5日 (五) 08:44
无编辑摘要
第7行:
第7行:
s.parentNode.insertBefore(hm, s);
s.parentNode.insertBefore(hm, s);
})();
})();
+
+
//右侧目录
+
$().ready(function(){
+
var b = $("<div id='rightToc' style='opacity: 0;'><div id='rtocbt'>目<br/>录</div></div>");
+
b.append($('#toc').children('ul').clone().removeAttr("style"));
+
$("#toc").after(b);
+
var IsAnim=false;
+
b.ready(function(){
+
$("#rightToc").children("ul").wrap("<div id='rtoculw'></div>");
+
$("#rtoculw").children("ul").attr('id','rtocul');
+
console.log($("#rtoculw").outerWidth());
+
$("#rightToc").css("marginRight",-$("#rtoculw").outerWidth());
+
$('#rtocbt').on('mouseover',function(){
+
if(IsAnim){
+
return;
+
}
+
IsAnim=true;
+
$("#rightToc").animate({
+
marginRight:'5px'
+
},"fast",function() {
+
IsAnim=false;
+
$('#rightToc').addClass('rtshow');
+
$('#rightToc').removeClass('rthide');
+
});
+
});
+
$($("#rtoculw")[0]).on('mouseleave',function(){
+
if(IsAnim){
+
return;
+
}
+
IsAnim=true;
+
$("#rightToc").animate({
+
marginRight:-$("#rtoculw").outerWidth()
+
},"fast",function(){
+
IsAnim=false;
+
$('#rightToc').addClass('rthide');
+
$('#rightToc').removeClass('rtshow');
+
});
+
});
+
$("#rightToc").css('opacity','1');
+
});
+
});
/* 回到顶部 */
/* 回到顶部 */
Zhbus
行政员
、
界面管理员
、
监督员
、
管理员
15,685
个编辑