下午好。我有一个图像 map ,需要打开一个点击图像的模式。 然而,我今天发现我不能使用标签来图像映射...... 我想知道如何使用图像 map 打开模式
它不是这样工作的:
<a href="<c:url value="/myApp/test"/>" data-toggle="modal" data-target="#new-modal"><area shape="rect" coords="289,399,368,662 ></a>
要运行 map ,必须没有标签“a href”,如下所示......
<area shape="rect" coords="289,399,368,662" href="<c:url value="/myApp/test"/>" data-toggle="modal" data-target="#new-modal">
只有这样才不会开启模态bootstrapping。
最佳答案
我遇到了同样的问题并遇到了这个解决方案。 我们应该从区域中删除 href 并包含 data-toggle="modal"和 data-target="#id"
<img src="desktop.jpg usemap="#May2May16-1">
<map name="May2May16-1" class="default">
<area shape="rect" coords="691,336,1239,375" style="outline:none" title="Offer Details" alt="Offer Details" data-toggle="modal" data-target="#myModal">
</map>
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
关于javascript - 单击图像映射并在 Bootstrap 中打开模式窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38754467/