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

ナビゲーションに移動 検索に移動
編集の要約なし
(ページの作成:「→‎ここにある全てのJavaScriptはモバイル版サイトの利用者に影響します: $(function() { $('section.collapsible-block').each(function() { var $section = $(this); if (!$section.hasClass('mw-collapsible')) { $section.addClass('mw-collapsible mw-collapsed'); $section.wrapInner('<div class="mw-collapsible-content"></div>'); // 直前の見出しクリックで開閉 var $heading…」)
 
編集の要約なし
タグ: モバイル編集 モバイルウェブ編集
1行目: 1行目:
/* ここにある全てのJavaScriptはモバイル版サイトの利用者に影響します */
/* ここにある全てのJavaScriptはモバイル版サイトの利用者に影響します */
$(function() {
mw.hook('mobileFrontend.content').add(function($content) {
     $('section.collapsible-block').each(function() {
     $content.find('section.collapsible-block').each(function() {
         var $section = $(this);
         var $section = $(this);
         if (!$section.hasClass('mw-collapsible')) {
         if (!$section.hasClass('mw-collapsible')) {
             $section.addClass('mw-collapsible mw-collapsed');
             $section.addClass('mw-collapsible mw-collapsed');
             $section.wrapInner('<div class="mw-collapsible-content"></div>');
             $section.wrapInner('<div class="mw-collapsible-content"></div>');
            // 直前の見出しクリックで開閉
             var $heading = $section.prev('h1, h2');
             var $heading = $section.prev('h1, h2');
             $heading.css('cursor','pointer').click(function() {
             $heading.css('cursor','pointer').click(function() {

案内メニュー