如何关闭 twitter 引导模式(初始启动后) [英] How to get twitter bootstrap modal to close (after initial launch)

查看:27
本文介绍了如何关闭 twitter 引导模式(初始启动后)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是个菜鸟,所以我想我正在使用 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 引导模式(初始启动后)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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