Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "MediaWiki:Common.js"

From PCGamingWiki, the wiki about fixing PC games
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);