简体   繁体   English

如何禁用峰值和弹出效果(iPhone 6s上的Safari具有强压力效果)

[英]How to disable peak & pop effect (strong pressure's effect with Safari on iPhone 6s)

I need to disable peak effect (strong pressure's effect with Safari on iPhone 6s) on "a" element in this code (bootstrap environment): 我需要在此代码中的“ a”元素(引导环境)上禁用峰值效果(在iPhone 6s上使用Safari在iPhone上施加强烈压力):

 <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> 

I need to disable it because if strong pressing with Safari on iPhone 6s then bootstrap's "modal" component is here in conflict with "peak", and it shows picture other than enlarged img.jpg. 我需要禁用它,因为如果在iPhone 6s上用Safari强烈按下,则引导程序的“模态”组件在此处与“峰值”冲突,并且它显示的图片不是放大的img.jpg。

So it would be nice to disable "peek" on "a" element or to show enlarged img.jpg when strong pressing with Safari on iPhone 6s. 因此,当在iPhone 6s上用Safari强烈按下时,最好禁用“ a”元素上的“窥视”或显示放大的img.jpg。

If you would like to disable peeking when you "strong" press an element on iOS you can set the webkit-user-select and the webkit-touch-callout property to none in css. 如果您想在“强”按iOS上的某个元素时禁止窥视,则可以在CSS中将webkit-user-selectwebkit-touch-callout属性设置为none。 If you are trying to prevent it on all "a" tags you could do something like this: 如果您试图在所有“ a”标签上禁止使用该标签,则可以执行以下操作:

a{
  -webkit-user-select:none;
  -webkit-touch-callout: none;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM