home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 March / Chip_2000-03_cd.bin / tema / Forrest / js / Images.js < prev    next >
Encoding:
JavaScript  |  1999-07-23  |  665 b   |  21 lines

  1. // Image Functions
  2. // changeImage() and preload() functions for rollovers and GIF animation
  3.  
  4. // Copyright (C) 1999 Dan Steinman
  5. // Distributed under the terms of the GNU Library General Public License
  6. // Available at http://www.dansteinman.com/dynduo/
  7.  
  8. function preload(imgObj,imgSrc) {
  9.     if (document.images) {
  10.         eval(imgObj+' = new Image()')
  11.         eval(imgObj+'.src = "'+imgSrc+'"')
  12.     }
  13. }
  14. function changeImage(layer,imgName,imgObj) {
  15.     //if (document.images) {
  16.         //if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
  17.         //else 
  18.         document.images[imgName].src = eval(imgObj+".src")
  19.     //}
  20. }
  21.