Difference between revisions of "MediaWiki:Common.js"
From PCGamingWiki, the wiki about fixing PC games
Masked Turk (talk | contribs) m (Blanked the page) |
|||
Line 1: | Line 1: | ||
+ | function addAnchorInHeaders() { | ||
+ | $('span.mw-headline', '#mw-content-text').each(function() { | ||
+ | var $this = $(this); | ||
+ | if ($this.attr('id') !== undefined) { | ||
+ | $('<a></a>').text('\xB6').attr({title: 'Link here', href: '#'+$this.attr('id')}).wrap('<span class="mw-linkhere"></span>').appendTo(this); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | $(addAnchorInHeaders); |
Revision as of 14:05, 11 September 2012
function addAnchorInHeaders() { $('span.mw-headline', '#mw-content-text').each(function() { var $this = $(this); if ($this.attr('id') !== undefined) { $('<a></a>').text('\xB6').attr({title: 'Link here', href: '#'+$this.attr('id')}).wrap('<span class="mw-linkhere"></span>').appendTo(this); } }); } $(addAnchorInHeaders);