MediaWiki:Common.js: Difference between revisions

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


/* JavaScript for rounding borders
/* JavaScript for rounding borders