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>
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>