I am looking for some help to get my code IE, NS and FF compatible. This is a basic event.x, event.y code that places an small image on a world map where ever the user clicks on the image. Here is the code that works in IE. If anyone can help me get this working in FF I would apprecited it. I have not tested with NS yet.
As far as FF goes I have read to use innerHTML and not innerText. I have also read you need to pass the event when you call the function. I made these changes but no luck with FF.
Here is the code…
[CODE]
</head>
<script language=”JavaScript”>
<!–
function markit(event) {
document.getElementById(‘xcoord’).innerHTML = event.x;
document.getElementById(‘ycoord’).innerHTML = event.y;
document.getElementById(‘xlayer’).style.left = (event.x-5);
document.getElementById(‘xlayer’).style.top = (event.y-5);
}
–>
</script>
<body>
<div style=”position:relative”>
<div id=”xlayer” style=”position:absolute; left:0px; top:0px; width:13px; height:14px; z-index:1″>
<img src=”x.png” width=”10″ height=”10″> </div>
<img src=”map.jpg” onClick=”markit(event);”> </div>
<br>
X Position: <span id=”xcoord”></span><br>
Y Position: <span id=”ycoord”></span><br>
</body>