Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: Javascript and tables
From: Sean Robertson
Date: Tue, 30 Jun 1998 19:16:35 +0100

What script did you use for your rollovers?  I found one that works far better than any other I have seen and with far fewer lines of code:
 
<html>
<head>
<script lang="JavaScript">
<!--
function change(name,file) {
  if (document.images)
    eval('document.images["'+name+'"].src="'+file+'"')
}
 
function preload() {
  if (document.images) {
    var imgFiles = preload.arguments;
    var preloadArray = new Array();
    for (var i=0; i<imgFiles.length; i++) {
      preloadArray[i] = new Image;
      preloadArray[i].src = imgFiles[i];
    }
  }
}
//-->
</script>
</head>
<body onLoad="preload('pagers_txt.gif')">
<img src="welcome_txt.gif" name="txt" height="34" width="134" border="0"><br>
<a href="pagers.html" onmouseover="change('txt','pagers_txt.gif');" onmouseout="change('txt','welcome_txt.gif');"><img src="pagers.gif"  border="0" height="33" width="33"></a><a href="cell.html" onmouseover="change('txt','cell_txt.gif');" onmouseout="change('txt','welcome_txt.gif');"><img src="cell.gif"  border="0" height="33" width="33"></a>
</body>
</html>
 
This code has no problems whatsoever in nested tables.  You can see it being used in just such a setup at http://www.uncc.edu/utimes/wire_011598/wire_current/news_1.html.  The utimes site was tested in a wide variety of web browsers including NN3 for Win95, Win3.x, Mac, and Sun Solaris.  I was the Assistant Online Editor for the paper during the first semester and built the design currently being used.  I got the change function from the Online Editor.  The preload function is a modified version of the Macromedia Dreamweaver  MM_preloadImages function.  The preload function, while not necessary for the rollover, does speed it up significantly by preloading the images into memory so that they don't have to be downloaded later.
 
P.S.  If you want to see your html in living color, just like the above code, point your browser to http://www.ultraedit.com and download their fully featured text editor.  It has syntax highlighting for up to seven different languages and find/replace in multiple files, making it ideal for programmers.
 
Feel free to email me if you would like more info on how to implement this script.
 
-----Original Message-----
From: Stumpy <stumpyjoatflash [dot] net>
To: flasheratshocker [dot] com <flasheratshocker [dot] com>
Date: Tuesday, June 30, 1998 1:26 PM
Subject: Re: Javascript and tables

>I had a problem with JavaScript Rollovers in netscape 3 when there was a
>nested table (ie table inside a table). The rollover worked when I took the
>second table out. Don't know if it helps your situation.
>Stumpy
>Internet Designs
>stumpyatepochworks [dot] com
>
>------------------------------------------------------------------------
>To UNSUBSCRIBE send: unsubscribe flasher in the body of an
>email to list-manageratshocker [dot] com.  Problems to: owneratshocker [dot] com
>N.B. Email address must be the same as the one you used to subscribe.
>For info on digest mode send: info flasher to list-manageratshocker [dot] com
>

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]