Team:Cornell/Templates/test
From 2011.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
<html> | <html> | ||
+ | |||
+ | <!-- Rollover script --> | ||
+ | |||
+ | <script language="javascript"> | ||
+ | /*** Use the name of your directory where your images are ie.. images, Images, img, what ever you have named your image directory***/ | ||
+ | var buttonFolder = "links/"; | ||
+ | |||
+ | /*** List your images here that will be on the page and then the mouse over images in the 2nd array ***/ | ||
+ | upSources = new Array("Abstract.jpg", "The_Project.jpg", "The_Team.jpg", "Multimedia.jpg"); | ||
+ | |||
+ | overSources = new Array("Abstractglow.jpg", "The_Projectglow.jpg", "The_Teamglow.jpg", "Multimediaglow.jpg"); | ||
+ | |||
+ | |||
+ | //*** DO NOT CHANGE ANYTHING BELOW THIS LINE ***// | ||
+ | totalButtons = upSources.length; | ||
+ | |||
+ | //*** MAIN IMAGES FUNCTIONS ***// | ||
+ | // PRELOAD MAIN MENU BUTTON IMAGES | ||
+ | function preload() { | ||
+ | for ( x=0; x<totalButtons; x++ ) { | ||
+ | buttonUp = new Image(); | ||
+ | buttonUp.src = buttonFolder + upSources[x]; | ||
+ | buttonOver = new Image(); | ||
+ | buttonOver.src = buttonFolder + overSources[x]; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // SET MOUSEOVER IMAGE | ||
+ | function setOverImg(But, ID) { | ||
+ | document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1]; | ||
+ | } | ||
+ | |||
+ | // SET MOUSEOUT IMAGE | ||
+ | function setOutImg(But, ID) { | ||
+ | document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1]; | ||
+ | } | ||
+ | |||
+ | //preload(); | ||
+ | </script> | ||
+ | |||
<style> | <style> | ||
body { | body { |
Revision as of 19:51, 15 July 2011