Team:Alberta/application.js

From 2011.igem.org

Revision as of 04:00, 12 July 2011 by HelenZ (Talk | contribs)

// This file for javascript that we want to include on all pages

$(document).ready(function(){

 // show the drop down list on hover
 $('li.headlink').hover(
   /*function() { $('ul', this).show(); },
   function() { $('ul', this).hide(); }*/
   function() { $('ul', this).css('display', 'table') },
   function() { $('ul', this).css('display', 'none') }
 );

});


function preload(images) {

   if (document.images) {
       var i = 0;
       var imageArray = new Array();
       imageArray = images.split(',');
       var imageObj = new Image();
       for(i=0; i<=imageArray.length-1; i++) {
           document.write('<img src="' + imageArray[i] + '" />');// Write to page (uncomment to check images)
           imageObj.src=images[i];
       }
   }

}