MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 12: Line 12:
     };
     };
  })();
  })();
addOnloadHook(function($) {
return function() {
$('.tabdiv > div').hide();
$('.tabdiv').each(function() {
$(this).find('> ul li').addClass('inactive');
$(this).find('> ul li:first').removeClass('inactive');
$(this).find('> ul li:first').addClass('active');
$(this).find('> div:first').show();
});
$('.tabdiv > ul li').each(function() {
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));


/** Collapsible tables code *****************************************************
/** Collapsible tables code *****************************************************
25,204

edits