MediaWiki:Common.js:修订间差异

跳到导航 跳到搜索
删除66字节 、​ 2022年5月4日 (星期三)
无编辑摘要
(撤销873756069讨论)的版本8645)
无编辑摘要
 
(未显示2个用户的23个中间版本)
第93行: 第93行:


/////分页tab///////
/////分页tab///////
function tabs() {
$(document).ready( function(){
  $(".tab").each(function(index) {
    $(".tab").each(function(indextabs) {
    $(this).click(function(e) {
        $(this).click(function(e) {
      triggletab();
            //所点击的同胞去除active
      triigletabcontent();
            $(this).siblings().removeClass("active");
      $(this).toggleClass("active");
            //同一个div下的 .tab-c 去除active
      $(".tab-c")
            $(this).parent().siblings().find(".tab-c").removeClass("active");
        .eq(index)
           
        .toggleClass("active");
            $(this).toggleClass("active");
            $(".tab-c")
                .eq(indextabs)
                .toggleClass("active");
        });
     });
     });
  });
});
  //to remove all tab headers
  function triggletab() {
    $(".tab").each(function() {
      $(this).removeClass("active");
    });
  }


  //triggle the tab content
  function triigletabcontent() {
    $(".tab-c").each(function() {
      $(this).removeClass("active");
    });
  } 
}
mw.hook( 'wikipage.content' ).add( tabs);
///////结束////////
///////结束////////

导航菜单