• <tfoot id='PTWTP'></tfoot>
    <i id='PTWTP'><tr id='PTWTP'><dt id='PTWTP'><q id='PTWTP'><span id='PTWTP'><b id='PTWTP'><form id='PTWTP'><ins id='PTWTP'></ins><ul id='PTWTP'></ul><sub id='PTWTP'></sub></form><legend id='PTWTP'></legend><bdo id='PTWTP'><pre id='PTWTP'><center id='PTWTP'></center></pre></bdo></b><th id='PTWTP'></th></span></q></dt></tr></i><div id='PTWTP'><tfoot id='PTWTP'></tfoot><dl id='PTWTP'><fieldset id='PTWTP'></fieldset></dl></div>

      <bdo id='PTWTP'></bdo><ul id='PTWTP'></ul>

  • <small id='PTWTP'></small><noframes id='PTWTP'>

      <legend id='PTWTP'><style id='PTWTP'><dir id='PTWTP'><q id='PTWTP'></q></dir></style></legend>

      1. Bootstrap Modal 在 iOS 设备上不起作用

        时间:2023-05-16
        • <bdo id='L7i39'></bdo><ul id='L7i39'></ul>

          <small id='L7i39'></small><noframes id='L7i39'>

          1. <tfoot id='L7i39'></tfoot>

            <i id='L7i39'><tr id='L7i39'><dt id='L7i39'><q id='L7i39'><span id='L7i39'><b id='L7i39'><form id='L7i39'><ins id='L7i39'></ins><ul id='L7i39'></ul><sub id='L7i39'></sub></form><legend id='L7i39'></legend><bdo id='L7i39'><pre id='L7i39'><center id='L7i39'></center></pre></bdo></b><th id='L7i39'></th></span></q></dt></tr></i><div id='L7i39'><tfoot id='L7i39'></tfoot><dl id='L7i39'><fieldset id='L7i39'></fieldset></dl></div>
            <legend id='L7i39'><style id='L7i39'><dir id='L7i39'><q id='L7i39'></q></dir></style></legend>
                    <tbody id='L7i39'></tbody>
                  本文介绍了Bootstrap Modal 在 iOS 设备上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在使用 Bootstrap 开发一个网站,但遇到了一个我似乎无法解决的问题.这是网站草稿.

                  I am working on a website using Bootstrap and have a problem I can't seem to fix. Here is the draft of the site.

                  在我们做什么"面板上,我在第一个缩略图框上制作了一个可点击的模式窗口(缩略图下方显示企业软件开发").如果您在非移动设备上单击缩略图,则会弹出一个模态窗口.

                  On the "What We Do" panel, I made a clickable modal window on the first thumbnail box (it says "Enterprise Software development" under the thumbnail). If you click the thumbnail on a non-mobile device, a modal window will pop-up.

                  在台式计算机(或笔记本电脑)上,它工作得很好.但在 iOS(iPhone、iPad 等)上,它根本不起作用:即点击它不会调出模态窗口.

                  On a desktop computer (or laptop), it works just fine. But on a iOS (iPhone, iPad, etc.) it doesn't work at all: i.e. tapping it doesn't bring up the modal window.

                  但是,如果您在我们是谁"面板中向下看页面,则会出现查看更多关于蒂姆..."的按钮.如果您在该按钮上单击或点击,它将适用于所有设备(包括 iOS).

                  However, if you look lower on the page at the "Who We are" panel, there is a "See more about Tim..." button. If you click or tap on that button, it will work across all devices (include iOS).

                  我可以看到两者之间的唯一区别是第一个在 <div> 标签上,而第二个在 <button> 标签.

                  The only difference I can see between the two is that the first one is on a <div> tag, whereas the second one is on a <button> tag.

                  Bootstrap 不支持从 iOS 设备上的 <div> 启动模式窗口吗?如果是这样,您是否发现我的代码有什么问题会导致它仅在 iOS 设备上失败?

                  Does Bootstrap not support starting up a modal window from a <div> on an iOS device? If it does, do you see anything wrong with my code that would make it fail only on iOS devices?

                  推荐答案

                  克里斯的回答是正确的.将 div 更改为 button 将有助于澄清您的标记.但是,如果您需要保持相同的标记,您还可以将 cursor:pointer 添加到您的 div 元素中,让 safari 知道这是可以点击的东西.它还让鼠标用户有一个标准的视觉提示,该元素也是可点击的.

                  Chris's answer is correct. Changing the div to a button would help clarify your markup. If, however, you need to keep the same markup, you can also add cursor: pointer to your div element to let safari know that this is something that might be clickable. It also let's mouse users have a standard visual cue that the element is clickable as well.

                  只需添加类clickable,然后包含以下CSS:

                  Just add the class clickable and then include the following CSS:

                  .clickable {
                      cursor: pointer;
                  }
                  

                  这也是 Fiddle 中的 MCVE 以及修复

                  注意我这里没有使用 Bootstrap 的 btn 类,因为它们会自动添加 cursor 规则.

                  Here's an MCVE in Fiddle with the fix as well

                  notice I haven't used Bootstrap's btn classes here because they will add the cursor rule automatically.

                  这篇关于Bootstrap Modal 在 iOS 设备上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iphone UIAlertView 模态 下一篇:presentModalViewController 上的不同过渡:动画:

                  相关文章

                  <tfoot id='zFEtq'></tfoot>

                      <small id='zFEtq'></small><noframes id='zFEtq'>

                      • <bdo id='zFEtq'></bdo><ul id='zFEtq'></ul>

                      <legend id='zFEtq'><style id='zFEtq'><dir id='zFEtq'><q id='zFEtq'></q></dir></style></legend>
                      <i id='zFEtq'><tr id='zFEtq'><dt id='zFEtq'><q id='zFEtq'><span id='zFEtq'><b id='zFEtq'><form id='zFEtq'><ins id='zFEtq'></ins><ul id='zFEtq'></ul><sub id='zFEtq'></sub></form><legend id='zFEtq'></legend><bdo id='zFEtq'><pre id='zFEtq'><center id='zFEtq'></center></pre></bdo></b><th id='zFEtq'></th></span></q></dt></tr></i><div id='zFEtq'><tfoot id='zFEtq'></tfoot><dl id='zFEtq'><fieldset id='zFEtq'></fieldset></dl></div>