
March 26th, 2005, 01:40 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Location: Saint Louis, MO
Posts: 13
Time spent in forums: 2 h 46 m 37 sec
Reputation Power: 0
|
|
|
Adding Area Maps programmatically
I have a grid based graphic that will contain image maps for each of the many cells of the grid. Though I can build the area tags on the server, this will generate more html than I want to send from server to client, as follows:
Code:
<Area Shape="rect" Coords="0,0,5,5" Href="javascript:clickCell(0,1);">
<Area Shape="rect" Coords="5,0,10,5" Href="javascript:clickCell(0,2);">
<Area Shape="rect" Coords="10,0,15,5" Href="javascript:clickCell(0,3);">
etc...
I found a link ( http://www.siteexperts.com/dhtml/ch9/chapter/part4.asp) that shows I can add area maps programmatically using DHTML. Using that code I could write javascript something like
Code:
var elArea = document.createElement("AREA");
elArea.coords = "10,0,15,5";
I have two questions:
1) Will this technique work in a browser other than IE? That is do other DOMs support the creation of area elements programmatically?
2) If I can use this technique, can I add the area's javascript HREF as I indicated above? If so, how?
Thank you for any assistance you can lend me.
ZLA
|