Twitter bootstrap modal not working(Twitter引导模式不起作用)
问题描述
我是 Twitter Bootstrap 的新手.我正在使用模态面板,但它没有被显示.它使屏幕变暗,但模态本身不会出现.我检查了错误控制台,没有错误.
I am new to Twitter Bootstrap. I am working on a modal panel, but it is not being displayed. It fades the screen, but the modal itself does not appear. I have checked the error console, and there are no errors.
我的代码在 <head>
标签内;我包括以下脚本:
My code is inside the <head>
tag; I include the scripts like:
<script src="aHR0cHM6Ly9hamF4Lmdvb2dsZWFwaXMuY29tL2FqYXgvbGlicy9qcXVlcnkvMS43LjEvanF1ZXJ5Lm1pbi5qcw=="></script>
<script type="text/javascript" src="Jmx0Oz9waHAgZWNobyAkcnVhZG1pbiA/Jmd0O2pzL2Jvb3RzdHJhcC5qcw=="></script>
<script src="Jmx0Oz9waHAgZWNobyAkcnVhZG1pbiA/Jmd0O2pzL3RhYmxlc29ydGVyL2pxdWVyeS50YWJsZXNvcnRlci5qcw=="></script>
<script src="Jmx0Oz9waHAgZWNobyAkcnVhZG1pbiA/Jmd0O2pzL3RhYmxlc29ydGVyL3RhYmxlcy5qcw=="></script>
模态页面:
<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-large">Launch demo modal</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" 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">Welcome</h3>
</div>
<div class="modal-body">
<p> Hello </p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
推荐答案
你需要使用 data-target
标签.
尝试将 href="#myModal"
属性替换为 data-target="#myModal"
.此外,你已经放了一个 hide
类,我猜它不应该在那里.
Try to replace the href="#myModal"
attribute with data-target="#myModal"
.
Besides, you have put a hide
class, I guess it shouldn't be there.
查看示例这里
这篇关于Twitter引导模式不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Twitter引导模式不起作用


- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Flexslider 箭头未正确显示 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01