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>
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.
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");
});
But this is not working at all
Also alternatively..jquery mobile surrounds pop-ups with a div having ID = "yourpopupid-popup" So you can simply hide that div.
I have faced same problem in using popup for toolbar menu (jQuery Mobile 1.2). For example:
Above code doesn't work on iPhone 5 (but works on android, iPhone4 etc). If I change it as below it works.
Got it. Add
data-history="false"
to thepopupBasic
Popup div.JS:
JSfiddle: Popup
Use two functions hide() or you can use close() function on clicking the button