选择交互式 jQuery 地图的状态
在我的项目中,我包含了一张交互式地图,类似于此:
http://davidlynch.org/js/maphilight/docs/demo_usa.html
<div class="event_map" style="display: block; background: url('map.png') repeat scroll 0% 0% transparent; position: relative; padding: 0pt; width: 260px; height:241px;">
<canvas width="260" height="241" style="position: absolute; left: 0pt; top: 0pt; padding: 0pt; border: 0pt none; opacity: 1;" id="image" width:260px;height:241px;=""></canvas>
<img style="opacity: 0; position: absolute; left: 0pt; top: 0pt; padding: 0pt; border: 0pt none;" id="image" src="map.png" alt="" class="map" usemap="#state-map" border="0" height="241" width="260">
</div>
<map name="state-map">
<area shape="poly" alt="" title="State Name" coords="74,18,79,17,80,15,85,13,91,13,93" href="/target/link" target="" />
</map>
那么开始吧:我应该使用什么作为我的选择器,图像本身还是它的区域地图?使用“标题”,还是为每个区域引入 ID?
In my project I've included an interactive map, similar to this one :
http://davidlynch.org/js/maphilight/docs/demo_usa.html
<div class="event_map" style="display: block; background: url('map.png') repeat scroll 0% 0% transparent; position: relative; padding: 0pt; width: 260px; height:241px;">
<canvas width="260" height="241" style="position: absolute; left: 0pt; top: 0pt; padding: 0pt; border: 0pt none; opacity: 1;" id="image" width:260px;height:241px;=""></canvas>
<img style="opacity: 0; position: absolute; left: 0pt; top: 0pt; padding: 0pt; border: 0pt none;" id="image" src="map.png" alt="" class="map" usemap="#state-map" border="0" height="241" width="260">
</div>
<map name="state-map">
<area shape="poly" alt="" title="State Name" coords="74,18,79,17,80,15,85,13,91,13,93" href="/target/link" target="" />
</map>
So to get started : what should I use as my selector, the image itself or it's area map? Use 'title', or introduce id's for each area ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想选择各个州,则需要使用该区域。
看起来该图像只是整个地图的单个图像 bkg。如果可能的话,我会尝试将 id 属性附加到区域标签,否则仅使用标题。
If you want to select individual states, you'll want to use the area.
It looks like the image is just a single image bkg of the whole map. I'd try to append an id attribute to the area tags if possible, otherwise just use the titles.