Bootstrap 3.1.0模态远程内容

时间:2014-02-25 21:53:55

标签: twitter-bootstrap modal-dialog

经过一些试验和错误,我得到了一个远程模态窗口加载并使用bootstrap 3.0.1销毁内容

passing a parameter to remote modal in bootstrap 3

这是代码段

$(document).ready(function(){
$('.pull-right').click(function(){

    var theid = this.id;

    //Open modal window passing the member id as a parameter        
    $('#myModal').modal({
    remote: '/plugins/mission/councilmember_popup.php?MemberID='+theid,
    show: true
    });
    //Destroy modal window content on close, otherwise parameter will be retained       
    $("#myModal").on('hidden.bs.modal', function () {
        $(this).data('bs.modal', null);
    });
}); 

});

我现在已经安装了3.1.0并且现在意识到远程模态不再有效,我得到了模态背景,但是看不到模态窗口

似乎无法在3.1.0中找到任何远程内容的例子,cananyone指向一个例子

1 个答案:

答案 0 :(得分:0)

认为我有答案......

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<!-- Modal content comes from the page in the href -->
<div class="modal-dialog">
    <div class="modal-content">

    </div>         <!-- /modal-content -->
</div>     <!-- /modal-dialog -->

</div><!-- /.modal -->

是主页的语法

<div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
             <h4 class="modal-title">Title</h4>
        </div>            <!-- /modal-header -->
          <div class="modal-body">
                        ...
          </div><!-- /modal-body -->
        <div class="modal-footer">
            <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
        </div>            <!-- /modal-footer -->

是远程内容的语法