PDA

View Full Version : newbie: rollover mouseup function failure.



firebox
May 15th, 2003, 12:33 AM
Hello!! What's up!

I'm green, so this might be a stupid question. I have two images, which I preloaded, that I'm trying to get to swap on onMouseUp. I'm not sure why, but all the codes tried have come up bad. I would be a happy kid if someone could look at this javascript and give me some direction.

Thanks.
The Oh So Tired FIReBOX

<html>
<head>
<title>Adam_Powell</title>
<meta name="Author" content="Adam Powell">
<meta name="description" content="Websites Design, Multimeda, Interactive, New Media, Adam Powell">
<script language="javaScript">
<!-- I hate this -->
welcome= new Image; welcome.src = "meat/main/spring.gif";
goodbye= new Image; goodbye.src = "meat/main/fall.gif";

function clicked(Image){
document.Image.src=goodbye;
}
function popwindow(){
scw=screen.width-8;
sch=screen.height-47;
// width=690
// height=1014
var Powell_window= window.open('Powell_01.htm','Powell','height=' + sch + ',width=' + scw + ',left=0,top=0')
}

</script>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" scrolling="no">
<table border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="100%" bgcolor="#ffffff">
<tr>
<td>
<div align="center">
<a href="javascript:popwindow()" onmouseover=" window.status='ClickIt'; return true"
onmouseout="window.status='Come On ClickIt'; return true" onmouseup="">
<img src="meat/main/spring.gif" alt="Click and Enter" name="duke" border="0">
</a>
</div>
</td>
</tr>
</table>
</body>
</html>

HairyTeeth
May 15th, 2003, 02:14 AM
Why bother with onmouseup anyway...try this.



<A href="Powell_01.htm"
onclick="popwindow();return false;"

onMouseover="document.test.src='meat/main/fall.gif';
window.status='Click It';return true"

onMouseOut="document.test.src='meat/main/spring.gif';
window.status='';return true">

<IMG src="meat/main/spring.gif" border="0" name="test">

</A>


This type o flink allows javascript disabled browsers to access the link but it allows javascript enabled browsers to get the popup.

document.test.src points to the img named "test". Use any name that you want but make sure you change the img name in the mouse event syntax.

See if that helps.

firebox
May 15th, 2003, 03:06 AM
Wow! THANK YOU!!!

I've no coder, and that helped a ton!!! I've been doing this for hours. lol.

thanks.