Javascript 如何将关闭按钮X设置为引导库灯箱?
我有一个带lightbox的引导图像库,我想在modal lightbox上显示关闭按钮X。这是我的HTML:Javascript 如何将关闭按钮X设置为引导库灯箱?,javascript,bootstrap-4,bootstrap-modal,lightbox,Javascript,Bootstrap 4,Bootstrap Modal,Lightbox,我有一个带lightbox的引导图像库,我想在modal lightbox上显示关闭按钮X。这是我的HTML: <div class="col-lg-4 col-sm-6 col-xs-12"> <div class="thumbnail"> <a href="https://farm1.staticflickr.com/665/23578574946_b6f90e1ca8_k.jpg" data-toggle="li
<div class="col-lg-4 col-sm-6 col-xs-12">
<div class="thumbnail">
<a href="https://farm1.staticflickr.com/665/23578574946_b6f90e1ca8_k.jpg" data-toggle="lightbox">
<img src="https://farm1.staticflickr.com/665/23578574946_b6f90e1ca8_k.jpg" class="img-fluid">
</a>
</div>
</div>
我知道,我应该将“alwaysShowClose”设置为“true”,但我不知道在哪里。引导4中模式的关闭按钮如下:
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
引导4中模式的关闭按钮如下所示:
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
在函数调用中传递参数
$(document).on('click', '[data-toggle="lightbox"]', function(event) {
event.preventDefault();
$(this).ekkoLightbox({
alwaysShowClose: true
});
})
在函数调用中传递参数
$(document).on('click', '[data-toggle="lightbox"]', function(event) {
event.preventDefault();
$(this).ekkoLightbox({
alwaysShowClose: true
});
})
这里是我使用模态插件的地方这里是我使用模态插件的地方非常感谢您的帮助!最后,我意识到从一开始使用基本引导模式会更容易。非常感谢您的帮助!最后,我意识到从一开始使用基本引导模式会更容易。