0

我正在实施一项功能。

特征

客观的 :

有一个带有 ajax 请求的弹出表单。 引导弹出窗口

注意:以前我尝试使用引导可编辑项来实现相同的目标

但由于我不希望数据(在弹出窗口中输入)显示在页面上。(可编辑用于)。

所以 ,

使用当前方法(jsfiddle)

问题 :

当我单击弹出框以在弹出框内输入数据时消失。

我正在寻找一个 jquery 修复程序。(带有事件传播的东西会做)

我的代码:

<div class="box-icon" >
    <div class="popover-markup">
        <a href="#" class="trigger"><i class="icon-plus-sign"></i></a> 
            <div class="head hide">Enter Email<i class="icon-remove" style="margin-left: 120px;"></i></div>
                <div class="content hide">
                      <input type="text" placeholder="Type email address">
                      <button type="submit" class="btn">Submit</button>
                </div>
            <div class="footer hide">test</div> 
    </div>
</div>

我的脚本是:

$( document ).ready(function() {

    $('.popover-markup > .trigger').popover({ 
        html : true,
        title: function() {
            return $(this).parent().find('.head').html();
        },
        content: function() {
            return $(this).parent().find('.content').html();
        }
    });

    // Attach click handler to document
    $(document).bind('click', function (e) {
        $(".popover-markup").popover('hide');
    });

    // Dont hide when I click anything inside #container
    $('.popover-markup').bind('click', function(e) {
        e.stopPropagation();
    });

});
4

0 回答 0