2014-01-17 69 views
-1

我想知道是否可以插入下面的div如何插入DIV直接在標籤的href區域形狀

<div id="cal1"> [dopbsp id="1" lang=it]</div> 

<div id="cal2"> [dopbsp id="1" lang=it]</div> 

<div id="cal3"> [dopbsp id="1" lang=it]</div> 

直接由不同形狀的區域鏈接的標籤href影像地圖如下

<area shape="circle" coords="160,59,20" href="#"> 
<area shape="circle" coords="111,58,20" href="#"> 
<area shape="circle" coords="60,59,20" href="#"> 

這樣,當我點擊形狀區域,例如

<area shape="circle" coords="160,59,20" href="#"> 

然後corresponden牛逼格,例如

<div id="cal1"> [dopbsp id="1" lang=it]</div> 

的地圖圖像 詩下加載:dopbsp id="1" ......是的WordPress的

感謝

回答

3

您不能在日曆預約插件。 <area>不能有任何子元素。有關更多信息,請參閱區域標籤上的World-wide Web compendium working draftMozilla Developer Network description

做到這一點的方法是通過ID,以給定的<area>與給定<div>連接和使用JavaScript來顯示/隱藏<div>當你點擊一個<area>。沿着線:

<area shape="circle" coords="160,59,20" href="#id-of-div-1"> 
<area shape="circle" coords="111,58,20" href="#id-of-div-2"> 
<area shape="circle" coords="60,59,20" href="#id-of-div-3"> 

<div class="divs-to-show-hide"> 
<div id="id-of-div-1">some content here</div> 
<div id="id-of-div-2">some content here</div> 
<div id="id-of-div-3">some content here</div> 
</div> 

jQuery的

$('area').on('click',function(e) { 
e.preventDefault(); 
$(this.href).show().siblings().hide(); 
});