Quick Cur,
Here's a MSIE and FireFox compatible version of the msie-only script i
sent you privately:
As you'll see, the mouse coordinates are posted in the status bar; when
they broach the inside of the red-dashed div box, the script will
trigger and re-locate the page to yahoo.com; for your needs, the
coordinates can equal the top left corner of your image, if it is
absolutely positioned on the page. (ie: you may have to detect the
image position if it is dynamically placed or relative to other
components). HTH - Jim
----------------------------------
<html>
<head>
<title>mouseTracker and event trigger based on mouse
coordinates</title>
<script language="javascript">
function mCo(evt ){
// create cross-browser event detector:
var node = (evt.target) ? evt.target : ((evt.srcElement)
?evt.srcElement : null );
evt = (evt) ? evt : ((event) ? event : null);
// create mouse coordinates objects:
xpo = evt.clientX;
ypo = evt.clientY;
// Set left-right, top-bottom params within 'if' stmt to equal
// the bounded box (or image) you want to detect:
if( (xpo >= 100) && (xpo <= 200 ) && (ypo >= 100) && (ypo <= 200) ){
window.location = "
http://www.yahoo.com";
}
// post all coordinates to the status bar while the mouse is moving:
window.status= "X-coordinate is: " + xpo + " Y-coordinate is: " +
ypo ;
}
</script>
</head>
<body bgcolor="black" color="white" onMousemove="mCo(event)">
<div style=" background-color:teal; color:white; border:3px gray ridge;
width:300px;
height:50px; z-index:1" id='the_box'>
Below is a red target area. Your mouse position will be tracked (see
the mouse coordinates in the status bar area) so that if your mouse
moves into the 'target' area, the window.location will change.
</div>
<div style="position:absolute; left:100; top:100;
background-color:transparent; border:1px red dashed; width:100px;
height:100px; z-index:2" id='targetarea'>
</div>
</body>
</html>
----------------------------------