Difference between revisions of "MediaWiki:Vector.js"

From The Infosphere, the Futurama Wiki
Jump to navigation Jump to search
m (moved User:Quolnok/vector.js to MediaWiki:Vector.js: globalisation)
(always intended to do this, hopefully it will become a larger variety)
Line 37: Line 37:
   
   
addOnloadHook(columnAreaImage);
addOnloadHook(columnAreaImage);
function randomiseMainPics(){
  if(wgTitle == "Main Page")
  {
    if(Math.random()>0.5)
    {
      var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox");
      mainRightBox[0].style.backgroundImage = "url(/images/4/45/VectorMainRightLeela.png)";
    }
    if(Math.random()>0.5)
    {
      var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox");
      mainBottomBox[0].style.backgroundImage = "url(/images/5/57/VectorMainBottomHedonism.png)";
    }
    if(Math.random()>0.5)
    {
      var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox");
      mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftZoidberg.png)";
    }
  }
}
addOnloadHook(randomiseMainPics);

Revision as of 16:12, 17 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")
  {
    if(Math.random()>0.5)
    {
      var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox");
      mainRightBox[0].style.backgroundImage = "url(/images/4/45/VectorMainRightLeela.png)";
    }
    if(Math.random()>0.5)
    {
      var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox");
      mainBottomBox[0].style.backgroundImage = "url(/images/5/57/VectorMainBottomHedonism.png)";
    }
    if(Math.random()>0.5)
    {
      var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox");
      mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftZoidberg.png)";
    }
  }
}
 
addOnloadHook(randomiseMainPics);