onmouseout not working

M

Matt L.

Does anyone know why the onmouseout isn't working in the following?
I've just started the script (tho I'm sure I've spent over 40hrs on
this problem alone) and am trying to get just 2 buttons working before
I add the other 4. I'm absolutely mystified by the sticky onmouseout.

I've combined a couple of scripts that I've found in the newsgroup to
accomodate the mouseovers and "active" button action. Only 1 button
can be active at a time.

If you need further info, let me know I'd be happy to furnish. Thanks
in advance for any advice/comments.
Matt


<html>
<head>
<script language="JavaScript">
<!--
var btnstate="down";
image01= new Image(42,42)
image01.src="new2_03.gif"
image02= new Image(42,42)
image02.src="new2_03-over.gif"
image03= new Image(42,42)
image03.src="new2_07.gif"
image04= new Image(42,42)
image04.src="new2_07-over.gif"

function rollover(imagename, newsrc){
document.images[imagename].src=newsrc.src
}

function setAllButtonsUp(btnstate){
//alert(btnstate);
document.example.src='new2_03-over.gif';
document.example2.src='new2_07.gif';
// document.upbutton3.src=new2_11.gif
// document.upbutton4.src=new2_13.gif
// document.upbutton5.src=new2_16.gif
// document.upbutton6.src=new2_19.gif
// document.upbutton7.src=new2_21.gif
}

function setAllButtonsUp2(btnstate){
//alert(btnstate);
document.example.src='new2_03.gif';
document.example2.src='new2_07-over.gif';
// document.upbutton3.src=new2_11.gif
// document.upbutton4.src=new2_13.gif
// document.upbutton5.src=new2_16.gif
// document.upbutton6.src=new2_19.gif
// document.upbutton7.src=new2_21.gif
}

//-->
</script>
</head>

<body>
<a href="#" onmouseover="rollover('example', image02)"
onmouseout="if(btnstate != down')rollover('example', image03)"

onclick="setAllButtonsUp('down');document.example.src='new2_03-over.gif';"><img
src="new2_03.gif" name="example">
</a>
<a href="#" onmouseover="rollover('example2', image04)"
onmouseout="if(btnstate != 'down')rollover('example2', image04)"

onclick="setAllButtonsUp2('up');document.example2.src='new2_07-over.gif';"><img
src="new2_07.gif" name="example2">
</a>
</body>

</html>
 
L

Lee

Matt L. said:
Does anyone know why the onmouseout isn't working in the following?
I've just started the script (tho I'm sure I've spent over 40hrs on
this problem alone) and am trying to get just 2 buttons working before
I add the other 4. I'm absolutely mystified by the sticky onmouseout.
<a href="#" onmouseover="rollover('example', image02)"
onmouseout="if(btnstate != down')rollover('example', image03)"

That missing quote doesn't jump out at you?
 
M

Matt L.

Thanks for the tip. I apologize for the sloppy code.

(I've been staring at these lines for several days now trying figure this
out)

In exasperation I must have left it out in my post. Unfortunately, putting
it where it belongs doesn't fix the problem for me.

Do you see anything else that is wrong or out of place?

Appreciate the feedback,
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top