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').click(function(){
     $('div.tabdiv > ul > li').each(function(){
        $(this).parent().find('> li').removeClass('active').addClass('inactive');
        var a = $(this).find('> a:first'), href = a.attr('href');
        $(this).removeClass('inactive').addClass('active');
        $(a).attr('href', '');
        $(this).parent().parent().find('> div').hide();
        $(this).click(function(){
        $($(this).find('> a:first').attr('href')).show();
                $(this).parent().find('> li').removeClass('active').addClass('inactive');
    }).each(function(){
                $(this).removeClass('inactive').addClass('active');
        $(this).find('> a:first').attr('href', '');
                $(this).parent().parent().find('> div').hide();
     })
                $(href).show();
        });
     });
     $('div.tabdiv > ul > li:first').click();
     $('div.tabdiv > ul > li:first').click();
});
});