加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – Bootstrap Modal立即消失

发布时间:2020-12-17 23:34:24 所属栏目:安全 来源:网络整理
导读:我在使用bootstrap的网站上工作。 (和我是一个新手在网页设计/编码) 基本上,我想在主页中使用模态,召唤的英雄单位的按钮。 按钮代码: button type="button" class="btn btn-warning btn-large" data-toggle="modal" data-target="#myModal"Open Modal/but
我在使用bootstrap的网站上工作。 (和我是一个新手在网页设计/编码)
基本上,我想在主页中使用模态,召唤的英雄单位的按钮。

按钮代码:

<button type="button" 
    class="btn btn-warning btn-large" 
    data-toggle="modal"
    data-target="#myModal">Open Modal</button>

模式代码:

<div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">In Costruzione</h3>
  </div>
  <div class="modal-body">
    <p>Test Modal: Bootstrap</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Chiudi</button>
    <button class="btn btn-warning">Salva</button>
  </div>
</div>

问题是,一旦我点击按钮,模态淡入,然后立即消失。
我试过我知道的一切,使它的工作,但不是!没有什么工作。

我真的很感激任何帮助,你可以给我。

对不起,我的英语,我是意大利人。

此外,有没有人知道如何改变下拉三角形的颜色(向上,没有悬停)。我在一个基于橙色和棕色的网站工作,这个蓝色的东西真的很烦人。
再次感谢!

解决方法

这是加载模态插件JavaScript两次的典型行为。请检查以确保您有bootstrap.js或bootstrap-modal.js,但不能同时使用两者。前者包括后者。 JavaScript插件文档页面的第一段说明:

Plugins can be included individually (though some have required dependencies),or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.

这里是一个演示,当两者都加载(只是为了确认您的体验)会发生什么:

Plunker

您可以删除或注释掉< script>行的bootstrap-modal.js在底部,并看到,这将修复它。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读