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="JavaS cript">
<!--
var btnstate="down" ;
image01= new Image(42,42)
image01.src="ne w2_03.gif"
image02= new Image(42,42)
image02.src="ne w2_03-over.gif"
image03= new Image(42,42)
image03.src="ne w2_07.gif"
image04= new Image(42,42)
image04.src="ne w2_07-over.gif"
function rollover(imagen ame, newsrc){
document.images[imagename].src=newsrc.src
}
function setAllButtonsUp (btnstate){
//alert(btnstate) ;
document.exampl e.src='new2_03-over.gif';
document.exampl e2.src='new2_07 .gif';
// document.upbutt on3.src=new2_11 .gif
// document.upbutt on4.src=new2_13 .gif
// document.upbutt on5.src=new2_16 .gif
// document.upbutt on6.src=new2_19 .gif
// document.upbutt on7.src=new2_21 .gif
}
function setAllButtonsUp 2(btnstate){
//alert(btnstate) ;
document.exampl e.src='new2_03. gif';
document.exampl e2.src='new2_07-over.gif';
// document.upbutt on3.src=new2_11 .gif
// document.upbutt on4.src=new2_13 .gif
// document.upbutt on5.src=new2_16 .gif
// document.upbutt on6.src=new2_19 .gif
// document.upbutt on7.src=new2_21 .gif
}
//-->
</script>
</head>
<body>
<a href="#" onmouseover="ro llover('example ', image02)"
onmouseout="if( btnstate != down')rollover( 'example', image03)"
onclick="setAll ButtonsUp('down ');document.exa mple.src='new2_ 03-over.gif';"><im g
src="new2_03.gi f" name="example">
</a>
<a href="#" onmouseover="ro llover('example 2', image04)"
onmouseout="if( btnstate != 'down')rollover ('example2', image04)"
onclick="setAll ButtonsUp2('up' );document.exam ple2.src='new2_ 07-over.gif';"><im g
src="new2_07.gi f" 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="JavaS cript">
<!--
var btnstate="down" ;
image01= new Image(42,42)
image01.src="ne w2_03.gif"
image02= new Image(42,42)
image02.src="ne w2_03-over.gif"
image03= new Image(42,42)
image03.src="ne w2_07.gif"
image04= new Image(42,42)
image04.src="ne w2_07-over.gif"
function rollover(imagen ame, newsrc){
document.images[imagename].src=newsrc.src
}
function setAllButtonsUp (btnstate){
//alert(btnstate) ;
document.exampl e.src='new2_03-over.gif';
document.exampl e2.src='new2_07 .gif';
// document.upbutt on3.src=new2_11 .gif
// document.upbutt on4.src=new2_13 .gif
// document.upbutt on5.src=new2_16 .gif
// document.upbutt on6.src=new2_19 .gif
// document.upbutt on7.src=new2_21 .gif
}
function setAllButtonsUp 2(btnstate){
//alert(btnstate) ;
document.exampl e.src='new2_03. gif';
document.exampl e2.src='new2_07-over.gif';
// document.upbutt on3.src=new2_11 .gif
// document.upbutt on4.src=new2_13 .gif
// document.upbutt on5.src=new2_16 .gif
// document.upbutt on6.src=new2_19 .gif
// document.upbutt on7.src=new2_21 .gif
}
//-->
</script>
</head>
<body>
<a href="#" onmouseover="ro llover('example ', image02)"
onmouseout="if( btnstate != down')rollover( 'example', image03)"
onclick="setAll ButtonsUp('down ');document.exa mple.src='new2_ 03-over.gif';"><im g
src="new2_03.gi f" name="example">
</a>
<a href="#" onmouseover="ro llover('example 2', image04)"
onmouseout="if( btnstate != 'down')rollover ('example2', image04)"
onclick="setAll ButtonsUp2('up' );document.exam ple2.src='new2_ 07-over.gif';"><im g
src="new2_07.gi f" name="example2" >
</a>
</body>
</html>
Comment