MediaWiki:Common.js: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 11: Line 11:


addOnloadHook(function(){
addOnloadHook(function(){
     $('div.tabdiv > ul > li').each(function(){
     $('div.tabdiv > ul > li').click(function(){
         var a = $(this).find('> a:first'), href = a.attr('href');
         $(this).parent().find('> li').removeClass('active').addClass('inactive');
        $(a).attr('href', '');
        $(this).removeClass('inactive').addClass('active');
        $(this).click(function(){
        $(this).parent().parent().find('> div').hide();
                $(this).parent().find('> li').removeClass('active').addClass('inactive');
        $($(this).attr('tabscope')).show();
                $(this).removeClass('inactive').addClass('active');
                $(this).parent().parent().find('> div').hide();
                $(href).show();
        });
     });
     });
     $('div.tabdiv > ul > li:first').click();
     $('div.tabdiv > ul > li:first').click();