MediaWiki:Scrollbar.js

/* Sets the default position of a horizontal scrollbar "thumb" to the center or the right, instead of on the left.

Intended for use in Template:GameNav.

Credits to UDB from Stack Overflow for the code: http://stackoverflow.com/users/1642219/udb

var outer=document.getElementById('outer').offsetWidth; var inner=document.getElementById('inner').offsetWidth;

$(document).ready(function{ $('.centerScroll').scrollLeft((inner-outer)/2); $('.rightScroll').scrollLeft(inner-outer); });

/* The code for vertical scrollbars, if ever it is needed.

var outerY=document.getElementById('outerY').offsetHeight; var innerY=document.getElementById('innerY').offsetHeight; $('.middleScroll').scrollTop((innerY-outerY)/2); $('.bottomScroll').scrollTop(innerY-outerY);