Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript/IE/Image Maps

Status
Not open for further replies.

nitelordz

Programmer
Jun 22, 2007
2
US
so here is my problem. i have four images, each with an image map associated with it. i have one page, and i do not want to do a page refresh. so i am using javascript to access the "src" and "useMap" attributes of the img tag.

the dilema comes into play when i switch from the first useMap to the second. If i then switch it back to the first one, life is good. however, if i introduce the third image map into the system, meanning, i have clicked on the first image, the first image map then swaps the graphic and useMap to the second level. so on the second level i click and want to go third level, when i swap the src to the third graphic, life is good, however, once i put a third imageMap into the useMap attribute, IE crashes an ugly death.

Firefox does not have to this problem.

Is there a workaround. This a general description of hte problem, the images and imagemaps that i am using approaches a 1000, so doing a javascript imageMap handler, not feasible, nor is the div switching as i would have to do 1000 divs, each with an imageMap and flip flop between em.

 
Interesting enough, after i posted the question i had a brain storm of an idea. instead of swapping the usemap attribute i just re wrote the innerHTML of the img to use the new src image and the new imageMap, and bada bing bada boom, it works like a soldier now.

we have setup multiple test pages, that demo the page, i can't show it to you though, as they are company property and have "trade secrets" in em, but the simplest thing to do woudl be to have a few images ( 3 at a minimum ), and then create 3 seperate imageMap. create 3 functions and paste em into the imageMap href calls, and try to replace the useMap attribute, on the 3rd one it fails, everytime.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top