Bootstrap 模态不工作
我有一个使用 bootstrap 模式的简单按钮,它就像一个弹出 div。我无法让它工作。当我点击按钮时,什么也没有发生。我使用的是火狐浏览器。我可能忘记了一些简单的事情,但我找不到问题所在。
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type='text/javascript' src='http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.js'></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
</head>
<body>
<a class="btn" data-controls-modal="my-modal" data-backdrop="static" id='mod'>Launch Modal</a>
</body>
</html>
I have a simple button that uses bootstrap's modal, which is like a popup div. I can't get it to work. When i click the button, nothing happens. Im using firefox. I'm probably forgetting something simple, but i can't find the problem.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type='text/javascript' src='http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.js'></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
</head>
<body>
<a class="btn" data-controls-modal="my-modal" data-backdrop="static" id='mod'>Launch Modal</a>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
另外,请确保包含 CSS 规则来设置背景元素的样式。例如:
also, make sure you include the css rules to style the backdrop elemen. For example:
您必须将此代码放入页面主体中,即弹出窗口(模式)的 html 代码。
此代码使用的 Less 文件是patterns.less。 my-modal 是弹出窗口的 id
希望这对您有用。
You have to put this code in your page body which is the html code of the pop-up(modal).
Less file used for this code is patterns.less. and my-modal is the id of the pop-up
Hope this works for you.