Antoniohawk
10-26-2003, 01:46 AM
I have the following code to change an image onMouseDown. I was wondering if it was possible to have the browser go to www.google.com onMouseUp. I dont want to have to use a "<a>" because of the little border that it produces.
<html>
<head>
<script language="JavaScript">
<!--
// PRELOADING IMAGES
if (document.images) {
img_on =new Image(); img_on.src ="splashDown.gif";
img_off=new Image(); img_off.src="splashUp.gif";
}
function handlePress() {
if (document.images) document.imgName.src=img_on.src;
}
function handleRelease() {
if (document.images) document.imgName.src=img_off.src;
}
//-->
</script>
</head>
<body>
<div onMouseDown="handlePress()" onMouseUp="handleRelease()">
<img src="splashUp.gif" border="0" name="imgName">
</div>
</body>
</html>
<html>
<head>
<script language="JavaScript">
<!--
// PRELOADING IMAGES
if (document.images) {
img_on =new Image(); img_on.src ="splashDown.gif";
img_off=new Image(); img_off.src="splashUp.gif";
}
function handlePress() {
if (document.images) document.imgName.src=img_on.src;
}
function handleRelease() {
if (document.images) document.imgName.src=img_off.src;
}
//-->
</script>
</head>
<body>
<div onMouseDown="handlePress()" onMouseUp="handleRelease()">
<img src="splashUp.gif" border="0" name="imgName">
</div>
</body>
</html>