「MediaWiki:Mobile.js」の版間の差分

提供: Kmchan Minecraft Wiki
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の1版が非表示)
5行目: 5行目:
             "title": "初心者向け",
             "title": "初心者向け",
             "href": "/カテゴリ:初心者向け"
             "href": "/カテゴリ:初心者向け"
        }, {
            "title": "建築",
            "href": "/カテゴリ:建築"
        }, {
            "title": "ディメンション",
            "href": "/カテゴリ:ディメンション"
        }, {
            "title": "モブ",
            "href": "/カテゴリ:モブ"
        }, {
            "title": "プラグイン",
            "href": "/カテゴリ:プラグイン"
         }]
         }]
     }].forEach(function(value, i) {
     }].forEach(function(value, i) {
16行目: 28行目:
             '</ul>'
             '</ul>'
         );
         );
         $(".navigation-btn").find(".navigation-content").hide().click(function(event) {
         $(".navigation-btn").last().find(".navigation-content").hide();
        $(".navigation-btn").last().click(function(event) {
             $(this).find(".navigation-content").slideToggle(500);
             $(this).find(".navigation-content").slideToggle(500);
         });
         });
     });
     });
});
});

2021年11月6日 (土) 20:04時点における最新版

$(document).ready(function() {
    [{
        "title": "カテゴリ",
        "dropdown": [{
            "title": "初心者向け",
            "href": "/カテゴリ:初心者向け"
        }, {
            "title": "建築",
            "href": "/カテゴリ:建築"
        }, {
            "title": "ディメンション",
            "href": "/カテゴリ:ディメンション"
        }, {
            "title": "モブ",
            "href": "/カテゴリ:モブ"
        }, {
            "title": "プラグイン",
            "href": "/カテゴリ:プラグイン"
        }]
    }].forEach(function(value, i) {
        $('#p-navigation').append(
            '<ul class="navigation-btn">' +
            '<li><a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>' + value.title + '</span></a></li>' +
            '<ul class="navigation-content">' +
            value.dropdown.map(function(value) {
                return '<li><a href="' + value.href + '" class="mw-ui-icon mw-ui-icon-before"><span>' + value.title + '</span></a></li>'
            }).join('') +
            '</ul>'
        );
        $(".navigation-btn").last().find(".navigation-content").hide();
        $(".navigation-btn").last().click(function(event) {
            $(this).find(".navigation-content").slideToggle(500);
        });
    });
});