0

我需要在此代码(引导环境)中的“a”元素上禁用峰值效果(iPhone 6s 上 Safari 的强压力效果):

<article>
  <div class="gall-thumbnail">
    <a data-toggle="modal" href="mod1#">
      <img src="img.jpg"/>
      <p class="text-center caption">Caption</p>
    </a>
  </div>
  <div class="modal fade" id="mod1">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h5 class="modal-title text-center">Caption</h5>
        </div>
        <div class="modal-body">
          <img src="img.jpg" class="img-responsive"/>
        </div>
      </div>
    </div>
  </div>
</article>

我需要禁用它,因为如果在 iPhone 6s 上用 Safari 强力按压,那么引导程序的“模态”组件在这里与“峰值”冲突,并且它显示的图片不是放大的 img.jpg。

因此,在 iPhone 6s 上用 Safari 强力按压时禁用“a”元素上的“peek”或显示放大的 img.jpg 会很好。

4

1 回答 1

0

如果您想在 iOS 上“强”按某个元素时禁用偷看,您可以在 CSS 中将webkit-user-selectwebkit-touch-callout属性设置为 none。如果您试图在所有“a”标签上阻止它,您可以执行以下操作:

a{
  -webkit-user-select:none;
  -webkit-touch-callout: none;
}
于 2016-06-14T13:16:04.527 回答