舰R百科是靠无数自愿编辑者持续地建设更新完善的。编辑非常简单,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

MediaWiki:Mobile.js:修订间差异

来自舰R百科
跳转到导航 跳转到搜索
(创建页面,内容为“→‎这里的任何JavaScript将为使用移动版网站的用户加载:​ $(function () { →‎模板:战舰少女R导航:​ $(".banner1").hover(functio...”
 
无编辑摘要
第1行: 第1行:
/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
  $(function () {
  $(function () {
         /*模板:战舰少女R导航*/
         /*战舰少女R导航*/
         $(".banner1").hover(function () {
         (function ($, de) {
            $(this).find(".banner2").eq(0).show();
            /*导航栏悬浮、点击展开*/
        }, function () {
            $(".banner1").hover(function () {
            $(this).find(".banner2").eq(0).hide();
                $(this).find(".banner2").eq(0).show();
        });
            }, function () {
        var isTouch = ('ontouchstart' in document.documentElement) ? 'touchstart' : 'click', _on = $.fn.on;
                $(this).find(".banner2").eq(0).hide();
        $.fn.on = function(){
            });
            arguments[0] = (arguments[0] === 'click') ? isTouch: arguments[0];
            var isTouch = ('ontouchstart' in de) ? 'touchstart' : 'click', _on = $.fn.on;
            return _on.apply(this, arguments);
            $.fn.on = function () {
        };
                arguments[0] = (arguments[0] === 'click') ? isTouch : arguments[0];
        $(".banner1").on("click",function(){
                return _on.apply(this, arguments);
            var obj=$(this).find(".banner2").eq(0);
            };
            if(obj.is("visible")){
            $(".banner1").on("click", function () {
                 obj.hide();
                var obj = $(this).find(".banner2").eq(0);
             }else{
                if (obj.is("visible")) {
                 obj.show();
                    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++;
             }
             }
            $(this).siblings().find(".banner2").hide();
 
        });
        }(jQuery, document.documentElement));


     })
     })

2016年5月24日 (二) 18:28的版本

/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
 $(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);
            };
            $(".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));

    })