Hello
I am looking to achieve the following:
- Display 5 images in a row
- Click on an image to show content related to that image
- Click another image to show that related content, and hide the previous content
Here is my markup for the images:
<div id="maps">
<div class="map-box"><h2>London & South East</h2><a href="#"><img src="/img/map_london.jpg" /></a></div>
<div class="map-box"><h2>South West, Ireland and Wales</h2> <a href="#"><img src="/img/map_south_west.jpg" /></a> </div>
<div class="map-box"><h2>South Central & Home Counties</h2> <a href="#"><img src="/img/map_south_central.jpg" /></a> </div>
<div class="map-box"><h2>North England, Northern Ireland & Scotland</h2> <a href="#"><img src="/img/map_north.jpg" /></a> </div>
<div class="map-box"><h2>Midlands</h2> <a href="#"><img src="/img/map_midlands.jpg" /></a> </div>
</div>
When a user clicks on the image, I would like to display the contents of a DIV directly beneath it. Like so:
<div id="london">
<p>content london</p>
</div>
<div id="south-west">
<p>content south west</p>
</div>
<div id="south-central">
<p>content south central</p>
</div>
<div id="north">
<p>content north</p>
</div>
<div id="midlands">
<p>content midlands</p>
</div>
This is clearly achievable via jQuery show/hide, but from all the examples I've looked at on Stack Overflow, I can't get the right combination.
Any tips much appreciated, thanks.