我有一个带有位置列表的图像地图,每个位置的详细信息都在旁边动态显示。目前,当您单击某个位置时,地图上会弹出一个圆圈。我希望能够单击地图上的一个点并让它显示一个工具提示,其中包含已经在 html 中的该位置的详细信息。如何将工具提示绑定到页面上已经存在的 div?此外,当单击某个位置时,相应的工具提示会与圆圈一起显示在地图上。
<ul id="boundList">
<li id="nid-854" state="seoul-korea" class="">
<div class="views-field views-field-title"> <span class="field-content">Seoul, Korea</span> </div></li>
<li id="nid-852" state="tokyo-japan" class="selected">
<div class="views-field views-field-title"> <span class="field-content">Tokyo, Japan</span> </div></li>
<li id="nid-855" state="chennai-india">
<div class="views-field views-field-title"> <span class="field-content">Chennai, India</span> </div></li>
<li id="nid-848" state="limburg-germany">
<div class="views-field views-field-title"> <span class="field-content">Limburg, Germany</span> </div></li>
<li id="nid-849" state="shanghai-china">
<div class="views-field views-field-title"> <span class="field-content">Shanghai, China</span> </div></li>
<li id="nid-859" state="huangshan-china">
<div class="views-field views-field-title"> <span class="field-content">Huangshan, China</span> </div></li>
<li id="nid-851" state="sorocaba-brazil">
<div class="views-field views-field-title"> <span class="field-content">Sorocaba, Brazil</span> </div></li>
</ul>
细节:
<div id="nid-852-content" class="row content active">
<h3>Tokyo, Japan</h3>
<h5>Support | Sales</h5> .... there's more info
</div>
这是我的地图:
<p><img id="locations-map" src="/images/website_map_.jpeg" / usemap="#locations"></p>
<map name="locations">
<area state="yucca-az" toolTip="" shape="circle" coords="178,211,15" href="#nid-857">
<area state="wittmann-az" shape="circle" coords="190,230,15" href="#nid-846">
<area state="torrence-ca" shape="circle" coords="159,228,15" href="#nid-858">
<area state="sorocaba-brazil" shape="circle" coords="385,439,15" href="#nid-851">
<area state="huangshan-china" shape="circle" coords="915,244,15" href="#nid-859">
<area state="limburg-germany" shape="circle" coords="568,167,15" href="#nid-848">
<area state="tokyo-japan" shape="circle" coords="974,225,15" href="#nid-852">
<area state="chennai-india" shape="circle" coords="794,307,15" href="#nid-855">
<area state="shanghai-china" shape="circle" coords="930,237,15" href="#nid-849">
<area state="canton-mi" shape="circle" coords="287,184,9" href="#nid-856">
<area state="seoul-korea" shape="circle" coords="948,212,15" href="#nid-854">
和 JS:
jQuery('#locations-map').mapster({
fillColor: 'efc254',
fillOpacity: 1,
stroke: true,
strokeColor: '03325e',
strokeWidth: 2,
singleSelect: true,
mapKey: 'state',
boundList: jQuery('#boundList').find('li'),
listKey: 'state',
listSelectedClass: 'selected',
showToolTip: true,
areas: [{'key': ''},
{'tooltip', ''}]
});
</map>