user1996304
user1996304

Reputation: 1

$.mobile.changePage with role popup in Jquery mobile?

Is it possible to have data role as popup in changePage with Jquery Mobile.

I am trying the following code

$.mobile.changePage('Last.html',{
            transition : 'slide',
                        role : 'popup'
});

Upvotes: 0

Views: 2276

Answers (1)

peterm
peterm

Reputation: 92805

Unfortunately from your question it's not clear why you need this.

Nevertheless, according to the jQM 1.2.0 documentation:

To create a popup, add the data-role="popup" attribute to a div with the popup contents. Then create a link with the href set to the id of the popup div, and add the attribute data-rel="popup" to tell the framework to open the popup when the link is tapped. This is a similar markup pattern to the dialog widget. A popup div HAS to be nested inside the same page as the link.

So you may not be able address external page (Last.html)

What you can do though:

  1. create appropriate markup for a popup in your jQM page
  2. if needed you can manipulate the content of your popup programmatically using popupbeforeposition and/or popupafteropen
  3. open a popup with popup("open") method

Here you can find one of the examples.

Upvotes: 1

Related Questions