Team:Brown-Stanford/Templates/Main

From 2011.igem.org

(Difference between revisions)
Line 11: Line 11:
var MyElement = "#random" //The ID of the element you want to change
var MyElement = "#random" //The ID of the element you want to change
-
var ImgPath = "" //The file path to your images
 
if (!document.getElementById(MyElement)) return false;
if (!document.getElementById(MyElement)) return false;
Line 25: Line 24:
var $header = document.getElementById(MyElement);
var $header = document.getElementById(MyElement);
var $backgroundurl = $header.style.backgroundImage;
var $backgroundurl = $header.style.backgroundImage;
-
var ImgURL = "url(" + ImgPath + random_images[rand(random_images.length)] + ")";
+
var ImgURL = "url(" + random_images[rand(random_images.length)] + ")";
if ($backgroundurl != ImgURL) {
if ($backgroundurl != ImgURL) {

Revision as of 22:06, 9 June 2011