MediaWiki:Common.js: Difference between revisions

m
Undo revision 191600 by Boxsnake (talk)
mNo edit summary
m (Undo revision 191600 by Boxsnake (talk))
Line 13: Line 13:
     };
     };
  })();
  })();
/*
addOnloadHook(function(){
addOnloadHook(function(){
     $('.tabdiv > div').hide();
     $('.tabdiv > div').hide();
Line 25: Line 26:
     });
     });
});
});
*/
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));


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