I'm creating a world map and there are flags in several countries. What I need to do is so that when someone hovers over a flag a DIV with content corresponding to that country slides down and then gets closed by clicking on a close button.
This is my basic HTML:
<map name="imgworldmap" id="imgworldmap">
<area shape="poly" coords="446,125,445,126" alt="">
<area shape="poly" coords="447,123,446,445" alt="">
etc....
</map>
<ul class="flags-container">
<li class="us">
<div class="flyout">Country A</div>
</li>
<li class="ht">
<div class="flyout">Country B</div>
</li>
<li class="uk">
<div class="flyout">Country C</div>
</li>
</ul>
This is my jQuery attempt (of course it doesn't work, it brings ALL flyouts out):
$(function(){
$('area').hover(function(){
$('.flyout').toggle();
});
});
Closing the flyout DIV, I know how to do that, so I don't need help with that part.
What I need help with is to have an area's corresponding DIV slide down.
Any help would be greatly appreciated.
Thanks!
**EDIT
Another more robust and scalable solution**
In the following link you'll find a solution that offers more functionalities and with better usability: