简体   繁体   English

jQuery Tooltip在iPhone 6中未关闭

[英]JQuery tooltip not close in iphone 6

when using jQuery tooltip in website it is properly work on all browser.but in mobile specially iphone 6 it is not working proprly.when click on it tooltip is open but it is not close any touch event.but click another tooltip previous one is closed.so please guild me to fixed this issue. 在网站上使用jQuery工具提示时,它可以在所有浏览器上正常工作,但是在移动设备上特别适用于iPhone 6,它不能正常工作。单击该工具提示时它已打开但未关闭任何触摸事件,但单击了另一个工具提示即上一个已关闭.so,请引导我解决此问题。

this is the issue but not fixed 这是问题,但没有解决

We had the same issue, specifically for iOS with both chrome and safari. 我们遇到了同样的问题,特别是对于同时具有Chrome和Safari的iOS。 We added the below jQuery snippet. 我们添加了以下jQuery代码段。 It does not work for 'click' event hence make sure the event is 'touchstart'. 它不适用于“单击”事件,因此请确保该事件为“ touchstart”。

$('body').on('touchstart', function(e){
         $("div.tooltip").hide();
});

when click tooltip set over layer between tooltip and body.after over layer click close both tooltip and over layer.finally this is work for me 当单击工具提示时,在工具提示和主体之间的图层上设置工具。在图层上单击后,同时关闭工具提示和工具图层。最后这对我来说是可行的

 jQuery( "#amount" ).tooltip(); jQuery('#amount').bind('touchstart' ,function(){ jQuery( "#amount" ).tooltip('open'); jQuery('#overlay').css('display', 'block'); }); jQuery('#overlay').bind('touchstart' ,function(){ jQuery('#overlay').css('display', 'none'); jQuery( "#amount" ).tooltip('close'); }); 
  #overlay{ display:none; position:absolute; top:0; left:0; width:100%; height:100%; z-index:1000; background-color:#333; opacity:.80; } #popup{ color: #333; display: none; position: absolute; top: 40%; left: 40%; width:200px; height: 200px; padding: 1em; border: 5px solid #333; background-color: white; text-align: left; z-index:1001; overflow: auto; font-size:16px; } 
 <link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.1/css/smoothness/jquery-ui.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.1/jquery-ui.js"></script> <input type="button" id="btn" value="Click Here" /> <div id="overlay"></div> <input id="amount" title="Please add."> 

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

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