- From: Brian Medendorp <medendob@lahs.losalamos.k12.nm.us>
- Date: Fri, 27 Feb 1998 09:58:54 -0700 (MST)
- To: Vidyut Luther <vluther@doconline.com>
- cc: W3 HTML Mailing list <www-html@w3.org>
I'm not sure if this is causing your problem, but the " and
using the actuall numerical index value, may be causeing at leat some
problems. Also IE 3.0 does not do a very good job with javascript and has
peoblems witht the rollovers anyway. Try using this code instead:
<SCRIPT LANGUAGE="JavaScript">
<!-- hide script
//image preload
mainu = new Image();
mainu.src = "images/main.gif";
mainh = new Image();
mainh.src = "images/main-h.jpg";
broadcasth = new Image();
broadcasth.src = "images/broadcast-h.jpg";
coolh = new Image();
coolh.src = "images/cool-h.jpg";
coolc = new Image();
friendsh = new Image();
friendsh.src = "images/friends-h.jpg";
searchh = new Image();
searchh.src = "images/search-h.jpg";
mailh = new Image();
mailh.src = "images/mail-h.jpg";
//MouseOver Function
function LightUp(ImageX,Text) {
document[ImageX].src = "images/" + ImageX + "-h.jpg";
window.status = Text
}
//MouseOut Function
function DimDown(ImageX) {
document[ImageX].src = "images/" + ImageX + ".gif";
window.status=''
}
//End JS Script hide-->
</SCRIPT>
if you wish to see this code in action go to:
http://saturn.lahs.losalamos.k12.nm.us/medendob/hwl/index.html
- [3rian :)
"I'm not sure, and correct me if I'm wrong, but I think I see a nipple."
-Jerry Seinfeld
On Fri, 27 Feb 1998, Vidyut Luther wrote:
> Hi,
> My question is regarding JavaScript and it's compatibility with browsers.
>
> I am working on a web page, and this is my first attempt at javascript,
> I'm attempting to do mouse overs, but i've been getting some wierd errors,
> when the page is viewed by different browsers.
>
> I designed the page using communicator 4.03 as the preview browser and
> notepad as the editor. anyway here is the source for the javascript and
> then i'll try and explain what it's supposed to do, and what the error
> messages are.
>
> <HTML>
> <HEAD>
>
> <SCRIPT language="javascript">
> function buttonSwap(idx, newImage)
> {document.images[idx].src = newImage;}
> </SCRIPT>
> <TITLE> Doc Online </TITLE>
> <BODY >
> <TABLE>
> <TR>
> <td colspan=2><CENTER>
> <A HREF="news/index.html" onMouseOver="buttonSwap(1,"newsbot.gif")" onMouseOut="buttonSwap(1, "newsup.gif")">
> <IMG SRC="newsup.gif" BORDER=0></A></CENTER>
> </TD></TR>
> </TABLE>
> </BODY>
> </HTML>
> if you see the code, you'll realize that it's a simple onmouseover, and
> onmouse out function. it works great in communicator 4.03. But when i
> tried to view it using IE 3.01, i got a javascript error, it said
> something about image can't be used as an array, and the same thing using
> netscape 2.02.
>
> But, when it's viewed through netscape 3.0, the whole page loads up fine
> and dandy, but once the mouse goes over any of the images on the table,
> another image is loaded up, but not right over the old image, it seems the
> new image is loaded a few pixels over the original image. I can't figure
> out why this is happening. can anyone help ?
>
> to see the whole page and it's whole cde point your browsers at
>
> http://www.doconline.com
> any help on this would be greatly apreciated
>
>
> Vidyut Luther
> http://www.doconline.com
> E-Mail:vluther@doconline.com
>
Received on Friday, 27 February 1998 11:59:04 UTC