JQuery移动工具提示弹出(“关闭”)功能在IPhone 5中不起作用 [英] JQuery mobile tool-tip popup("close") function is not working in IPhone 5

查看:144
本文介绍了JQuery移动工具提示弹出(“关闭”)功能在IPhone 5中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的JQuery Mobile网站中,我添加了一个工具提示对话框,在页面加载时打开,它将在5秒后消失。我的代码类似于以下内容:

In my JQuery Mobile site I've added a tool-tip dialog box to open when the page is load and It'll disappear after 5sec. My code is similar to follows,

  <div data-role="popup" id="popupInfo">
     <p>This is a completely basic popup, no options set.<p>
  </div>

  <script type="text/javascript">
 $(document).live( 'pagechange',function(event){
     $('#popupInfo').popup("open")
      setTimeout(function() {
      $('#popupInfo').popup("close");
      }, 5000);
  });
   </script>

除了 IPhone 5 iOS 6 之外,此更新在所有设备中均正常运行。因为当我尝试在 IPhone 5 iOS 6 设备中加载带有上述脚本的JQuery移动页面时,它会在弹出窗口关闭时将我重定向到上一页。我不确定我在这里错过了什么,但对我而言,jQuery Mobile popup(close)功能似乎不支持 iPhone 5 iOS 6

This update is working fine in all devices except in IPhone 5 iOS 6. Because when I tried to load my JQuery mobile page with above script in IPhone 5 iOS 6 device it redirect me to the previous page when the popup closing. I'm not sure what I've missed here but for me it looks like jQuery Mobile popup("close") function is not supporting for IPhone 5 iOS 6.

此外,当工具提示加载到追加到URL的哈希标记文本后,我们如何避免这个#& ui-state = dialog

Also when the tool-tip load following hash tag text appending to the URL how can we avoid this #&ui-state=dialog

有谁能告诉我们如何解决这个问题?

Could anyone please let me know how can we solve this issue ?

我'甚至尝试过以下代码;

I've even tried following code also;

 $(document).on('pagechange',function(event){
        $('#popupInfo').popup("open").delay(2000).popup("close");

    });

但这根本不起作用

推荐答案

知道了。将 data-history =false添加到 popupBasic 弹出div。

Got it. Add data-history="false" to the popupBasic Popup div.

<!-- Button / works without it -->
<a href="#popupBasic" data-rel="popup">Open Popup</a>

<!-- Popup #popupBasic -->
<div data-role="popup" id="popupBasic" data-history="false">
<p>This is a completely basic popup.<p>
</div>

JS:

<script type="text/javascript">

 $(document).live( 'pagechange',function(){
 $('#popupBasic').popup("open")
  setTimeout(function() {
  $('#popupBasic').popup("close");
  }, 5000);
 });

</script>

JSfiddle:弹出窗口

JSfiddle: Popup

这篇关于JQuery移动工具提示弹出(“关闭”)功能在IPhone 5中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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