Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Bootstrap Popover x按钮起作用,但第一次单击后标题消失_Jquery_Css_Twitter Bootstrap_Popover - Fatal编程技术网

Jquery Bootstrap Popover x按钮起作用,但第一次单击后标题消失

Jquery Bootstrap Popover x按钮起作用,但第一次单击后标题消失,jquery,css,twitter-bootstrap,popover,Jquery,Css,Twitter Bootstrap,Popover,我基本上使用了这个问题中的说明: 然而,一件奇怪的事情发生了。单击x后,标题将完全消失,并且在重新加载页面之前不会再次出现 这是我的密码: $(document).ready(function(){ $('[data-toggle="popover"]').popover({ }).on('shown.bs.popover', function() { var popup = $(this); $(this).parent().find("div.

我基本上使用了这个问题中的说明:

然而,一件奇怪的事情发生了。单击x后,标题将完全消失,并且在重新加载页面之前不会再次出现

这是我的密码:

$(document).ready(function(){
    $('[data-toggle="popover"]').popover({
    }).on('shown.bs.popover', function() {
        var popup = $(this);
        $(this).parent().find("div.popover .close").click(function() {
            popup.click();
        });
    });
});
我有bootstrap和jquery,包括css和js,我相信是最新版本


下面是代码笔示例:

您使用的引导程序版本错误。要使其正常工作,您需要Bootstrap v。3.3.5. 这是工作代码笔:

$(文档).ready(函数(){
$('[data toggle=“popover”]')。popover({
位置:'顶部',
是的,
标题:“修改公式集”,
内容:“一些内容”,
}).on('show.bs.popover',function(){
var popup=$(这个);
$(this.parent().find(“div.popover.close”)。单击(函数(){
弹出。单击();
});
});
});

你能对这个问题做一个代码笔或jsFiddle吗?最后使用了这个。我也采纳了卡万·弗林的建议,转而使用更新版本的引导。多亏了你们两个。@Dansafe应该接受@Cananflyn的答案——他发现了问题所在。我从头开始重新创建了这个案例,因为我从未注意到您使用的是较旧的
js
文件。接受了您的建议。这似乎是唯一的问题。
<div id="myDiv">
    <a  class="btn btn-lg btn-default extra" data-toggle="popover" data-html="true" title="Modify Formulary <a href='#' class='close' data-dismiss='alert'>×</a>" data-placement="left"  data-content='SOME CONTENT  '><i class="menu-icon fa fa-edit"></i></a> 
</div>
    .popover-title .close{
    position: relative;
    bottom: 3px;
}
cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js
$(document).ready(function() {
  $('[data-toggle="popover"]').popover({
    placement: 'top',
    html: true,  
    title: 'Modify Formulary <a href="#" class="close" data-dismiss="alert">×</a>',
    content: 'SOME CONTENT  ',
  }).on('shown.bs.popover', function() {
    var popup = $(this);
    $(this).parent().find("div.popover .close").click(function() {
      popup.click();
    });
  });
});