Difference between revisions of "MediaWiki:Vector.js"
Jump to navigation
Jump to search
(always intended to do this, hopefully it will become a larger variety) |
(more images) |
||
Line 42: | Line 42: | ||
if(wgTitle == "Main Page") | if(wgTitle == "Main Page") | ||
{ | { | ||
var rand = Math.random(); | |||
if(rand>0.6666) | |||
{ | { | ||
var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox"); | var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox"); | ||
mainRightBox[0].style.backgroundImage = "url(/images/4/45/VectorMainRightLeela.png)"; | mainRightBox[0].style.backgroundImage = "url(/images/4/45/VectorMainRightLeela.png)"; | ||
} | } | ||
if(Math.random()>0. | else if(rand>0.3333) | ||
{ | |||
var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox"); | |||
mainRightBox[0].style.backgroundImage = "url(/images/0/03/VectorMainRightProf.png)"; | |||
} | |||
rand = Math.random(); | |||
if(rand>0.6666) | |||
{ | { | ||
var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox"); | var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox"); | ||
mainBottomBox[0].style.backgroundImage = "url(/images/5/57/VectorMainBottomHedonism.png)"; | mainBottomBox[0].style.backgroundImage = "url(/images/5/57/VectorMainBottomHedonism.png)"; | ||
} | } | ||
if(Math.random()>0. | else if(rand>0.3333) | ||
{ | |||
var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox"); | |||
mainBottomBox[0].style.backgroundImage = "url(/images/a/aa/VectorMainBottomHermes.png)"; | |||
} | |||
rand = Math.random(); | |||
if(rand>0.6666) | |||
{ | { | ||
var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox"); | var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox"); | ||
mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftZoidberg.png)"; | mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftZoidberg.png)"; | ||
} | |||
else if(rand>0.3333) | |||
{ | |||
var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox"); | |||
mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftAmy.png)"; | |||
} | } | ||
} | } |
Revision as of 16:35, 21 August 2009
function columnAreaImage(){ var divFooter; if (document.getElementById ) { divFooter= document.getElementById("footer"); } else if (document.all ) { divFooter= document.all["footer"]; } else { return; } var newdiv = document.createElement('div'); newdiv.setAttribute('id', 'columnAreaImage'); var footHeight = (divFooter.offsetHeight)+(divFooter.offsetTop); if(footHeight > 900) { newdiv.style.top = footHeight - 408+"px"; } else { return; } newdiv.style.backgroundImage = "url(/images/a/aa/VectorSidebarInfosphere.png)"; newdiv.style.backgroundPosition = "bottom left"; newdiv.style.backgroundRepeat = "no-repeat"; newdiv.style.position = "absolute"; newdiv.style.left = "0px"; newdiv.style.width = "377px"; newdiv.style.height = "408px"; newdiv.style.zIndex = "-1" document.body.appendChild(newdiv); } addOnloadHook(columnAreaImage); function randomiseMainPics(){ if(wgTitle == "Main Page") { var rand = Math.random(); if(rand>0.6666) { var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox"); mainRightBox[0].style.backgroundImage = "url(/images/4/45/VectorMainRightLeela.png)"; } else if(rand>0.3333) { var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox"); mainRightBox[0].style.backgroundImage = "url(/images/0/03/VectorMainRightProf.png)"; } rand = Math.random(); if(rand>0.6666) { var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox"); mainBottomBox[0].style.backgroundImage = "url(/images/5/57/VectorMainBottomHedonism.png)"; } else if(rand>0.3333) { var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox"); mainBottomBox[0].style.backgroundImage = "url(/images/a/aa/VectorMainBottomHermes.png)"; } rand = Math.random(); if(rand>0.6666) { var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox"); mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftZoidberg.png)"; } else if(rand>0.3333) { var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox"); mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftAmy.png)"; } } } addOnloadHook(randomiseMainPics);