Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery mobile popup close button - how to close without going back?

I'm using the new popup dialog in jquery mobile 1.2.0 to display a bunch of youtube videos. Here are the popup examples I'm using:

http://jquerymobile.com/demos/1.2.0/docs/pages/popup/popup-iframes.html

Notice the maps example... it's a fancybox style with a close button. I've made my video popup do the same thing. The difference is the additional close link, added to the popup like so:

<a href="##" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>

Here's the problem: After opening one video and then closing it, then opening the next video and closing it, the first video shows up again. I think it's because the previous video is where "back" is in the history, and the close box is implemented as "back".

Is there a built in way to implement the close box as a true "close", or would I need to do it via javascript?

like image 237
Redtopia Avatar asked Oct 17 '12 23:10

Redtopia


1 Answers

@Redtopia, thanks for the response. I fixed my issue by setting the myPopup.popup({ history: false }); option on the popup. Then everything works fine.

like image 57
Ian Devlin Avatar answered Sep 26 '22 21:09

Ian Devlin