gpt4 book ai didi

javascript - 弹出框在关闭后第一次点击时不显示

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:15:07 24 4
gpt4 key购买 nike

我正在研究 this demo .我试图发现为什么弹出窗口在通过 .close 按钮关闭后第一次点击时不起作用。

 $("#pop-One").popover({
placement: 'right',
html: 'true',
title : '<span class="text-info" style=""><strong>Model Type</strong></span>'+
'<button type="button" class="btn btn-default close" onclick="$("#pop-One").popover("hide");">×</button>',
content : '<p class="popup" style="color:#323232;"> \Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s,</p>'
});
@import 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css';
@import 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css';
body{padding:20px;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<div class="container">
<button type="button" class="btn btn-default" id="pop-One" data-toggle="popover"><i class="fa fa-question"></i></button>
</div>

无论出于何种原因,关闭按钮在这里不起作用。我已经看到了this post但这是一种不同的方法。

最佳答案

不知道这是不是最好的解决方案,但它的工作

  $("#pop-One").popover({
placement: 'right',
html: 'true',
title : '<span class="text-info" style=""><strong>Model Type</strong></span>'+
'<button type="button" class="btn btn-default close"\
onclick="$(&quot;#pop-One&quot;).popover(&quot;hide&quot;);">×</button>',
content : '<p class="popup" style="color:#323232;"> \Lorem Ipsum is simply dummy\ text of the printing and typesetting industry. Lorem Ipsum has been the industry standard\ dummy text ever since the 1500s,</p>'
}).on('shown.bs.popover', function() {
var popup = $(this);
$(this).parent().find("div.popover .close").click(function() {
popup.click();
});
});

here the result of my efforts

关于javascript - 弹出框在关闭后第一次点击时不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33407069/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com