Inside Technique : Text Hot Spots
A hot spot is a region on the screen when the user clicks something happens. The most common type of hot spots on a web page are navigation links which bring the user to a new page or part of a document. With the introduction of scripting, instead of navigating, you often want code to execute in response to the user clicking on a hot spot.
In Internet Explorer 4.0, you can respond to clicks on any element by simply
This solution only works in IE4 since it requires the document object model and full access to your entire
document. You can learn more about this approach in our original hot spot article.
For Netscape Navigator, the only HTML text elements that can respond to
clicks are the link <A>nchor and its close cousin, the <AREA> element. Link elements are <A> and <AREA> elements with an
Below we rewrite the IE4 specific example in a cross-browser way. In this example
we are using CSS to override the default anchor style and remove the underline.
Returning false to the
There is still one remaining issue with the above solution - the URL is displayed
in the status bar when mouse hovers over the anchor. Since the link is not being used
to navigate no URL should be displayed. This is easily fixed by changing
the status bar text when the mouse moves over the anchor using the
For this to work cross-browser, Netscape requires the
By using link anchors to create hot spots you also get benefits beyond it working cross-browser. The hot spot is included in the tabbing order of the document and for special browsers (eg., speech browsers), the user is notified of the hot spot since it appears as an ordinary link.
© 1997-2000 InsideDHTML.com, LLC. All rights reserved.