Robert Taylor
Robert Taylor

Reputation: 89

Image Map Not working in FF & IE (with onclick javascript)

For the life of me this is not working and I can not figure out why..

<div class="b2s-popup" id="hideaway">
<img src="back-in-groove.jpg" usemap="b2schoolpop" />
<map name="b2schoolpop" id="b2schoolpop">
  <area shape="rect" coords="304,289,403,308" href="#" />
  <area shape="rect" coords="365,-6,426,24" href="javascript:;" onClick="document.getElementById('hideaway').style.display='none';" />
</map>
</div>

Upvotes: 0

Views: 1202

Answers (2)

Robert Taylor
Robert Taylor

Reputation: 89

and I am an idiot. Usemap should have been "#b2schoolpop" and not "b2schoolpop"

Upvotes: 1

A. Agius
A. Agius

Reputation: 1271

Try this;

<div class="b2s-popup" id="hideaway">
<img src="back-in-groove.jpg" usemap="b2schoolpop" />
<map name="b2schoolpop" id="b2schoolpop">
  <area shape="rect" coords="304,289,403,308" href="#" />
  <area shape="rect" coords="365,-6,426,24" href="javascript:document.getElementById('hideaway').style.display='none';" />
</map>
</div>

Or

<div class="b2s-popup" id="hideaway">
<img src="back-in-groove.jpg" usemap="b2schoolpop" />
<map name="b2schoolpop" id="b2schoolpop">
  <area shape="rect" coords="304,289,403,308" href="#" />
  <area shape="rect" coords="365,-6,426,24" href="javascript:void(0);" onclick="javascript:document.getElementById('hideaway').style.display='none';" />
</map>
</div>

Upvotes: 0

Related Questions