使用引导程序加载打开模式弹出窗口?

Posted

技术标签:

【中文标题】使用引导程序加载打开模式弹出窗口?【英文标题】:on load open model popup using bootstrap? 【发布时间】:2015-08-29 05:12:16 【问题描述】:

模型在点击时打开:

 <a href="#" data-remodal-target="test" >test</a>

我的型号代码是:

 <div class="remodal" data-remodal-id="test">
    <h3 class="modal-middle-heading">Buy</h3>
    <p>Please select your desired gift city.</p>
    <form class="login-form">
        <input type="text" placeholder="Search City" />
    </form>
    <button>Search</button>
</div>

如何在加载时打开模型?

【问题讨论】:

***.com/questions/10233550/… 【参考方案1】:

试试这个,

<script type="text/javascript">
    $(window).load(function()
        $('#test').modal('show');
    );
</script>

【讨论】:

【参考方案2】:

假设您使用的是remodal,您可以在onload 事件中以编程方式打开模型。像这样的:

  window.onload = function ()                                                 
    $('[data-remodal-id=test]').remodal().open();                              
  ; 

见demo

【讨论】:

以上是关于使用引导程序加载打开模式弹出窗口?的主要内容,如果未能解决你的问题,请参考以下文章