Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i have a website where i am trying to make a museover menu but the code i am using is not working neither on firefox or internet explorer. can anyone help me out please.

my code is below:

XML
<SCRIPT LANGUAGE="JavaScript">
    <-- begin
    loadImage1 = new Image();
    loadImage1.src = "Images\Buttons2.png";
    staticImage1 = new Image();
    staticImage1.src = "Images\Buttons1.png";//>
    </script>
<title> DGC </title>
</HEAD>
<BODY bgcolor="0e1113">
<center> <img src="Images\Header1.png" width="1250" height="250"> </center>
<br><br>
<a href="http://www.google.co.uk" onmouseover="image1.src=loadImage1.src;" onmouseout="image1.src=staticImage1.src;">
<img name="image1" src="Images\Buttons1.png" border="0"> </a>


i have also tried the following:

XML
<BODY bgcolor="0e1113">
    <a href="http://www.google.co.uk"> <img src="Images\Buttons1.png"
    onmouseover="src='Images\Buttons2.png'"
    onmouseout="src='Images\Buttons1.png'"
    onclick="src='Images\Buttons3.png'"> </a>


thanks in advance to any helpers

amir
Posted
Updated 1-Jun-11 7:31am
v2
Comments
Bruno Tagliapietra 1-Jun-11 12:51pm    
you're aiming moon shooting with a slingshot... totally wrong man.

try here
http://www.learnwebdesignonline.com/css-tutorials/verticalmenu.htm

1 solution

I changed your code like this
<head>
<script language="JavaScript">
    loadImage1 = new Image();
    loadImage1.src = "Images\Buttons2.png";
    staticImage1 = new Image();
    staticImage1.src = "Images\Buttons1.png";
    </script>
<title> DGC </title>
</head>
<body bgcolor="0e1113">
<center> <img src="Images\Header1.png" width="1250" height="250"> </img></center>
<br><br>
<a href="http://www.google.co.uk" onmouseover="image1.src=loadImage1.src;" önmouseout="image1.src=staticImage1.src;">
<img name="image1" src="Images\Buttons1.png" border="0"> </img></a>
</br></br></body>


and this is working fine

just removed <-- begin part I could not understand why r you using this.

If you want to create Mouseover Menus search on google you will find a lot like
Pure CSS Menus[^]
Dropdown menu utility - Using Javascript, CSS and DOM[^]
 
Share this answer
 
v2
Comments
hamza_786 1-Jun-11 16:00pm    
thank you, it did work. the problem wasn't in the code. for some reason the web page and the images have to be in the same directory instead of having the images in an 'Images\...'directory.
hamza_786 1-Jun-11 16:02pm    
p.s my slashes were the wrong way, so i can have them in different directories with '/' but not '\'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900