MediaWiki:Common.js: Difference between revisions

From Warzone Wiki
Jump to navigation Jump to search
Grzechooo (talk | contribs)
m Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: jQuery(document).ready(function($){ →‎for collapsible navboxes: toggleHeader = function(index) { ..."
 
Grzechooo (talk | contribs)
mNo edit summary
Line 8: Line 8:
$('.navbox').each(function(index){
$('.navbox').each(function(index){
$(this).attr('id', 'navbox-' + index);
$(this).attr('id', 'navbox-' + index);
});
$('.navbox-content').each(function(index){
$(this).attr('id', 'navbox-content-' + index);
});
});
});
});

Revision as of 10:34, 25 August 2011

/* Any JavaScript here will be loaded for all users on every page load. */

jQuery(document).ready(function($){
	/* for collapsible navboxes */
	toggleHeader = function(index) {
		$('#navbox-' + index + '#navbox-content-' + index).toggle('slow');
	};
		$('.navbox').each(function(index){
			$(this).attr('id', 'navbox-' + index);
		});
		
		$('.navbox-content').each(function(index){
			$(this).attr('id', 'navbox-content-' + index);
		});
});