Jquery mobile popup close button - how to close without returning?

I am using the new pop-up dialog in jQuery mobile 1.2.0 to display a bunch of YouTube videos. Here are the examples I use:

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

Check out the example cards ... it's a fancybox style with a close button. I made a popup for the video by doing the same. The difference is an additional closing link added to the popup, for example:

<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 will appear again. I think because the previous video is where the “back” is in the history, and the “close” field is implemented as “back”.

Is there a built-in way to implement the close window as a true "close", or will I need to do this through javascript?

+4
source share
1 answer

@ Redtopia, thanks for the answer. I fixed my problem by setting the option myPopup.popup({ history: false }); in a popup window. Then everything works fine.

+15
source

Source: https://habr.com/ru/post/1440419/


All Articles