MediaWiki:Common.js: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 13: Line 13:
     };
     };
  })();
  })();
addOnloadHook(function($) {
addOnloadHook(function(){
return function() {
    $('.tabdiv > div').hide();
$('.tabdiv > div').hide();
    $('div.tabdiv > div:first').show();
$('.tabdiv').each(function() {
    $('div.tabdiv > ul > li').removeClass('inactive');
$(this).find('> ul li').addClass('inactive');
    $('div.tabdiv > ul > li:first').addClass('active');
$(this).find('> ul li:first').removeClass('inactive');
    $('div.tabdiv > ul > li').click(function(){
$(this).find('> ul li:first').addClass('active');
        $(this).parent().parent().find('> div').hide();
$(this).find('> div:first').show();
        $((this).find('> a:first').attr('href')).show();
});
        $(this).parent().find('>li').removeClass('active').addClass('inactive');
$('.tabdiv > ul li').each(function() {
        $(this).removeClass('inactive').addClass('active');
var a = $(this).find('a:first');
    });
var target = a.attr('href');
});
$(a).attr('href', ''); // Opera hates real hrefs
$(this).click(function() {
$(this).parent().find('> li').removeClass('active');
$(this).parent().find('> li').addClass('inactive');
$(this).parent().parent().find('> div').hide();
$(this).addClass('active');
$(this).removeClass('inactive');
$(target).show();
return false;
});
});
}
}(jQuery));


/****************************** Slides JS ******************************/
/****************************** Slides JS ******************************/