html - 无法在模态上关闭模态
问题描述
我有 2 个模态框(当我按下小狗图像时会打开第二个模态框)
我的问题是,一旦我打开第二个,我就不能再关闭它们了,只是打开和关闭第一个就没有任何问题。
这是我的代码:
<div class="modal hide fade" id="moreModal<?php echo $row["dog_id"]; ?>" tabindex="-1" data-focus-on="input:first">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="moreModalLabel"><?php echo $row["dog_name"]; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<b>Name:</b> <?php echo $row["dog_name"]; ?> <br>
<b>Born:</b> <?php echo $row["born_date"]; ?> <br>
<b>Height:</b> <?php echo $row["height"]; ?> <br>
<b>Weight:</b> <?php echo $row["weight"]; ?> <br>
<b>Castration:</b> <?php echo $row["castration"]; ?> <br>
<b>Description:</b> <?php echo $row["dog_desc"]; ?> <br>
</div>
<div class="container">
<div class="row mx-2">
<div class="col-2 my-2">
<img class="gallery_image" id="myImg" width="100%" height="90" style="object-fit: cover;" data-toggle="modal" href="#img_modal_large" src="<?php echo $row["image_dog"]; ?>" alt="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="img_modal_large" class="modal hide fade" tabindex="-1" data-focus-on="input:first">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<img src="<?php echo $row["image_dog"]; ?>" alt="">
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn">Close</button>
</div>
</div>
<?php }; ?>
解决方案
所以我现在设法解决了我的问题......
我刚刚做了: z-index: 2147483647 !important;
推荐阅读
- python - 如何比较python中的两列?
- certificate - Let's Encrypt 可以为一个域名分发多个证书吗?
- solidworks - 使STEP文件所有实体的坐标系up-z
- windows - gdbserver - glob 无法处理模式“(空)”
- c++ - 当我在支持 avx2 的机器上编译并在另一台只支持 avx 的机器上运行二进制文件时会发生什么?
- mysql - 检索购买了超过 13 种不同产品但从未购买过相同产品的客户
- kubernetes - prometheus 无法监控 kubernetes 中的所有 pod
- javascript - 增加整个 HTML 页面的大小?
- python - 如何将所有用户输入存储在列表中?
- c++ - C++ 随机生成的字典单词只会显示以 B 开头的单词