...

View Full Version : "On Mouseover" picture display problem



Virginia
06-01-2004, 08:32 PM
First of all, I am very new to this and I am trying to teach myself...I may not know all the correct jargon with which to ask my question, but here's the issue.

Situation: I have tried to create some buttons which "dissolve" into another picture when the mouse pointer is on top of them. Then they "dissolve" back to the original graphic.

Problem: The code appears to function properly, as the "dissolve" happens. The original graphic is there. However, when I put the mouse pointer on the picture, it "dissolves" into that little white box with the red 'x' inside...then when I move the mouse out, it "dissolves" back to the original graphic. :confused:

Source: There are two different sources from which I got the code to do this. One of them you copy and fill in the paths to the graphics used. The other was the javascript kit. On the javascript kit, the demo of my selected code was functioning perfectly. But when I put it into my html file, it did the same thing as the first code I copied...I have also triple checked (several times) that the paths are correct for my pictures. Also I pasted the code into the correct places...For weeks... :confused:

I am suspecting that I am using an incompatible HTML editor. Or perhaps, in my newbieness, I am not supposed to use an HTML editor at all! I have never had any problems viewing things on the browser, so I believe that is not where the problem is. I am not sure. For the sake of space I will not post the code yet. Please let me know if further information is needed to answer my question.

I appreciate any assistance provided on this most frustrating matter. I've been trying to figure it out on my own for weeks... :eek:

Thanks,
Virginia :)

Antoniohawk
06-01-2004, 09:40 PM
I'll just go ahead and ask the obvious so that the javascript gurus won't have to. Can we please see your code and possibly a link to the page? That will help us out immensely.

Virginia
06-01-2004, 10:12 PM
Thank you for your reply! Here is the code for the page. It is not online yet, all paths are to the hard drive. I preview it by opening it in my browser.
Thanks again!


<HTML>
<HEAD>
<TITLE>TITLE HERE</TITLE>
<META NAME="GENERATOR" CONTENT="Cool HTML 1.0">
<META NAME="FORMATTER" CONTENT="Cool HTML 1.0">
<script language="javascript1.1">
<!--

/*Code generated by the onMouseover whipper
Visit http://javascriptkit.com for more info*/

c939=new Image(100,30)
c939.src="C:\My Documents\My Pictures\Backgrounds\Tada\yellow_weave_on.jpg"
c321=new Image(100,30)
c321.src="C:\My Documents\My Pictures\Backgrounds\Tada\yellow_weave_off.jpg"
//-->
</script>
<script>
<!--
function filter(imagename,objectsrc){
if (document.images)
document.images[imagename].src=eval(objectsrc+".src")
}
//-->
</script>
</HEAD>

<BODY BGCOLOR="#ffffff" TEXT="#000000" LINK="#0000ff"
VLINK="#0000ff" ALINK="#0080ff">
<a href="yoururl.htm"
onmouseover="filter('c458','c321')"
onmouseout="filter('c458','c939')">
<img src="C:\My Documents\My Pictures\Backgrounds\Tada\yellow_weave_on.jpg" name="c458" border=0 width=100 height=30></a>


</BODY>
</HTML>

Willy Duitt
06-01-2004, 10:46 PM
Try changing this line: document.images[imagename].src=eval(objectsrc+".src")

To this: document.images[imagename].src=objectsrc.src

Virginia
07-05-2004, 08:18 AM
:) I haven't been here in a while but thank you for your help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum