Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'd suggest having all the images on the page, positioned on top of each other. The below will add all the images linked to by the area to a container then crossfade when you click...</p> <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; jQuery(function($){ $('#Map area').each(function(){ var area = $(this); var img = $('&lt;img&gt;').attr('src', area.attr('href')); $('#imgcontainer').append(img); area.click(function(){ $('#imgcontainer img').stop().fadeOut(); img.stop().fadeIn(); return false; }) }); $('#imgcontainer img:first-child').show(); }); &lt;/script&gt; &lt;style&gt; #imgcontainer{width:260px;height:193px;} #imgcontainer img{display:none;position:absolute;} &lt;/style&gt; &lt;img src="button.jpg" width="260" height="193" border="0" usemap="#Map" /&gt; &lt;map name="Map" id="Map"&gt; &lt;area shape="rect" coords="61,21,120,55" href="A.img" /&gt; &lt;area shape="rect" coords="147,21,205,54" href="B.img" /&gt; &lt;area shape="rect" coords="60,58,121,90" href="C.img" /&gt; &lt;area shape="rect" coords="147,59,205,92" href="D.img" /&gt; &lt;area shape="rect" coords="61,92,121,125" href="E.img" /&gt; &lt;area shape="rect" coords="146,96,205,128" href="F.img" /&gt; &lt;area shape="rect" coords="60,128,122,163" href="G.img" /&gt; &lt;area shape="rect" coords="146,131,204,164" href="I.img" /&gt; &lt;/map&gt; &lt;div id="imgcontainer"&gt;&lt;/div&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload