|
Using VBScript to Get Image Map Coordinates When putting together a client-side image map, you need to determine the appropriate x- and y-coordinates for each clickable region of the image. If you're running Netscape Navigator or Internet Explorer 4, you can use a trick to get the browser to show you the coordinates in the status bar. Specifically, you set up your image as a link and then include ISMAP inside the <IMG> tag, like this: <A HREF="nothing"><IMG SRC="YourImageMap.gif" ISMAP></A> Unfortunately, this doesn't work with Internet Explorer 3. However, you can use a simple VBScript routine to program similar behaviour into IE. First, add the following script between the </HEAD> and <BODY> tags of your Web page:
<SCRIPT LANGUAGE="VBScript">
Sub ImageMap_MouseMove(shift, button, x, y)
status = x & "," & y
End Sub
</SCRIPT>
Next, add the attribute ID="ImageMap" to your mock link, like so:
<A HREF="nothing" ID="ImageMap"><IMG SRC="YourImageMap.gif"></A> Now, when you move your mouse over the image, the coordinates appear in the status bar. Give it a try: Copyright © 1995-2012 Paul McFedries and Logophilia Limited |