MediaWiki:Common.js:修订间差异
MediaWiki界面页面
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第414行: | 第414行: | ||
/* 导航 */ | /* 导航 */ | ||
$(function () { | $(function () { | ||
$(".banner1").hover(function () { | /*战舰少女R导航*/ | ||
(function ($, de) { | |||
/*导航栏悬浮、点击展开*/ | |||
$(".banner1").hover(function () { | |||
$(this).find(".banner2").eq(0).show(); | |||
}, function () { | |||
$(this).find(".banner2").eq(0).hide(); | |||
}); | |||
var isTouch = ('ontouchstart' in de) ? 'touchstart' : 'click', _on = $.fn.on; | |||
$.fn.on = function () { | |||
arguments[0] = (arguments[0] === 'click') ? isTouch : arguments[0]; | |||
return _on.apply(this, arguments); | |||
}; | |||
obj.hide(); | $(".banner1").on("click", function () { | ||
} | var obj = $(this).find(".banner2").eq(0); | ||
if (obj.is("visible")) { | |||
obj.hide(); | |||
} else { | |||
obj.show(); | |||
} | |||
$(this).siblings().find(".banner2").hide(); | |||
}); | |||
/*导航栏倒计时*/ | |||
var now = new Date(); | |||
var nows = now.getTime(); | |||
now.setHours(0); | |||
now.setMinutes(0); | |||
now.setSeconds(0); | |||
var today = now.getTime(); | |||
var passed = Math.floor((nows - today) / 1000); | |||
changeCountDown(); | |||
setInterval(function () { | |||
changeCountDown(); | |||
}, 1000); | |||
function changeCountDown() { | |||
var lave = 24 * 60 * 60 - passed,h = Math.floor(lave / 3600), m = Math.floor((lave - h * 3600) / 60), s = lave - h * 3600 - m * 60,_s='',_c='#0F3'; | |||
if(passed<60) _s=",成功+1day"; | |||
if(passed>12*3600) _c="#fc0"; | |||
if(passed>23*3600) _c="#F30"; | |||
$("#zjsnr-lavetime").html("<span style='color:"+_c+"'>"+h+"</span>"+"小时" +"<span style='color:"+_c+"'>"+m+"</span>" + "分" + "<span style='color:"+_c+"'>"+s+"</span>" + "秒"+_s); | |||
passed++; | |||
} | } | ||
}(jQuery, document.documentElement)); | |||
}) | }) | ||