Spencer wrote:
Howie,
I have a similar problem and posted a question a few weeks ago without
receiving any responses. In my situation we have one image that is
basically a "front" and "back" image. However, the image map needs to
have different hot spots depending on if the viewer is looking at the
front or the back. I have tried to use html() to re-write the image
map html code and then remove() to take out the old. I'm able to see
the image map code swap out, unfortunately the hot spots stay are
still the same as the removed image map. It's almost like the browser
needs to reload the DOM after the HTML change, but that doesn't make
any sense to me.
Well, I've got my workaround working OK, but it's old-skool:
$('map#weathermap_imap').empty()
// doesn't do anything -> $('map#weathermap_imap').html(cont);
var oldskool = document.getElementById('weathermap_imap');
oldskool.innerHTML = cont; // works fine
For your situation, have you considered having two imagemaps and just
switching the usemap attribute (using attr) at the same time that you
change the src attribute?
Howie