User:Marioluvswii
From Homestar Runner Wiki
(Difference between revisions)
Marioluvswii (Talk | contribs) m |
Marioluvswii (Talk | contribs) m |
||
Line 1: | Line 1: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
<SCRIPT TYPE="text/javascript"> | <SCRIPT TYPE="text/javascript"> | ||
<!-- | <!-- | ||
- | + | // copyright 1998 Idocs, Inc. http://www.idocs.com/tags/ | |
- | // | + | // Distribute this script freely, but please keep this |
- | + | // notice with the code. | |
- | + | // var image information object | |
- | + | var mloi=new Object(); | |
- | + | ||
- | + | // set the image for swapping | |
- | + | function setswap() | |
- | + | { | |
- | + | if (! document.images)return; | |
- | + | var imgInfo=new Object(); | |
- | + | imgInfo.defaultImg = new Image(); | |
- | + | imgInfo.defaultImg.src = document.images[arguments[0]].src; | |
- | + | imgInfo.opts = new Object(); | |
- | + | for (var i=1; i < arguments.length; i=i+2) | |
- | + | { | |
- | + | imgInfo.opts[arguments[i]]=new Image(); | |
+ | imgInfo.opts[arguments[i]].src = arguments[i+1]; | ||
+ | } | ||
+ | mloi[arguments[0]] = imgInfo; | ||
+ | } | ||
+ | |||
+ | // set up the link for swapping | ||
+ | function swap(link,imgName,optName) | ||
+ | { | ||
+ | if (! document.images)return; | ||
+ | if (! link.swapReady) | ||
+ | { | ||
+ | link.imgName = imgName; | ||
+ | link.onmouseout = swapBack; | ||
+ | link.swapReady = true; | ||
+ | } | ||
+ | document.images[imgName].src=mloi[imgName].opts[optName].src; | ||
+ | } | ||
+ | |||
+ | function swapBack() | ||
+ | {document.images[this.imgName].src=mloi[this.imgName].defaultImg.src} | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
//--> | //--> | ||
</SCRIPT> | </SCRIPT> | ||
+ | lol |
Revision as of 03:15, 19 October 2008
<SCRIPT TYPE="text/javascript"> </SCRIPT> lol