Bootstrap Modal不显示 [英] Bootstrap Modal doesn't show

查看:225
本文介绍了Bootstrap Modal不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试Bootstrap的模态元素并创建一个小测试页.但是什么都没有出现,我想知道为什么,有任何线索吗?我从引导页面获取了源代码.我的测试页面位于 http://ronhome .no-ip.org/bootstrap/modal.html

I wanted to test out Bootstrap's modal element and created a little test page. But nothing shows up and I'm wondering why, any clues? I got the source from the bootstrap page... My test page is at http://ronhome.no-ip.org/bootstrap/modal.html

推荐答案

首先,您需要包括jquery并触发模式,方法是使用按钮-

first thing you need to include jquery, and also trigger the modal, either with a button -

<button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>

或使用jquery显示引导模态-

or show the bootstrap modal using jquery -

<script type="text/javascript">
$(document).ready(function(){
    $('.modal').modal('show');
});
</script>

这篇关于Bootstrap Modal不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆