什么是在页面加载时显示bootstrap 2.0模式的最佳方法。

时间:2012-02-25 01:54:12

标签: javascript jquery twitter-bootstrap

例如,我有一个必须在用户登录之前显示的模式。

1 个答案:

答案 0 :(得分:2)

这是bootstrap模式脚本的默认行为,例如:

show |  boolean/default: true | Shows the modal when initialized.

当然,只要在窗口加载或正文中初始化脚本调用,就像这样:

$(window).load(function(){
    $('#myModal').modal({
        keyboard: false
    })
}); 

Documentation

这是一个Demo,默认行为保持不变。这是另一个demo,其中添加了show : false选项。