问题描述
我是个菜鸟,所以我想我正在使用 twitter 引导模式来监督一些事情(可能很明显).我想要做的是让一个模式只在移动设备上启动.这适用于在模态 div 上添加类 .visible-phone .到现在为止还挺好.但是我希望它能够工作,这意味着您可以使用 X 按钮将其关闭.而且我无法让按钮工作.
I'm very much a noob, so I think I'm overseeing something (probably obvious) with twitter bootstrap modal. What I am trying to do is get a modal to launch only on mobile. This works fine with adding the class .visible-phone on the modal div. So far so good. But then I want it to work, meaning you can close it with the X button. And I cannot get the button to work.
<div class="modal visible-phone" id="myModal">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>text introductory<br>want to navigate to...</h3>
</div>
<div class="modal-body">
<ul class="nav">
<li> ... list of links here </li>
</ul>
</div>
</div>
在 html 的底部,我放了 jquery.js(第一个)和 bootstrap.modal.js 和 bootstrap.transition.js.实际上所有的引导 js 模块(不要错过包含).我对js没有经验..
In the bottom of the html I put jquery.js (first) and bootstrap.modal.js and bootstrap.transition.js. Actually all of the bootstrap js modules (not to miss an include).I'm not experienced with js..
如果我提出了一个非常愚蠢的问题,请原谅我.我在日志中找不到这种特定情况的答案.
Please forgive me if I posed a really stupid Q. I could not find the answer to this specific situation in the log.
推荐答案
$('#myModal').modal('hide')
应该这样做
这篇关于如何关闭 twitter 引导模式(初始启动后)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!