How To Insert Div Directly In Tag Href Area Shape
I wish to know if it is possible to insert following divs
[dopbsp id='1' lang=it]
[dopbsp id='1' lang=it]
&lSolution 1:
You cannot. <area>
cannot have any child elements. See the World-wide Web compendium working draft on the area tag or the Mozilla Developer Network description for more information.
The way to do this is to connect a given <area>
with a given <div>
via IDs and use JavaScript to show/hide the <div>
when you click on an <area>
. Along the lines of:
<areashape="circle"coords="160,59,20"href="#id-of-div-1"><areashape="circle"coords="111,58,20"href="#id-of-div-2"><areashape="circle"coords="60,59,20"href="#id-of-div-3"><divclass="divs-to-show-hide"><divid="id-of-div-1">some content here</div><divid="id-of-div-2">some content here</div><divid="id-of-div-3">some content here</div></div>
jQuery
$('area').on('click',function(e) {
e.preventDefault();
$(this.href).show().siblings().hide();
});
Post a Comment for "How To Insert Div Directly In Tag Href Area Shape"