单击图像映射并在引导程序中打开模态窗口

click image map and open modal window in bootstrap

本文关键字:模态 窗口 引导程序 图像 映射 单击      更新时间:2023-09-26

下午好。我有一个图像地图,需要打开一个模态点击图像。然而,我今天发现我不能使用标签来进行图像映射。。。我想知道如何使用图像地图打开模态

它不是这样工作的:

<a href="<c:url value="/myApp/test"/>" data-toggle="modal" data-target="#new-modal"><area shape="rect" coords="289,399,368,662 ></a>

要运行映射,必须没有以下标记"a href"。。。

<area shape="rect" coords="289,399,368,662" href="<c:url value="/myApp/test"/>" data-toggle="modal" data-target="#new-modal">

只有这样才能打开模式自举。

我遇到了同样的问题并遇到了这个解决方案。我们应该从区域中删除href,并包括datatoggle="modal"和datatarget="#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">&times;</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>