Ivo
Ivo

Reputation: 529

Is it possible to have a scrolling listview inside a popup using jQuery Mobile?

I want to create something like the image on the right in this picture:

http://media.smashingmagazine.com/wp-content/uploads/2012/03/4.19_Walmart1.jpg

Basically I want the popup to fill my screen, but not extend downwards when the listview is too big. It should enable the user to scroll the list within the popup. Currently I can't find a solution to limit the height of the popup. I'm using the latest jQuery Mobile.

Any suggestions are more than welcome!

Regards, Ivo

Upvotes: 0

Views: 2345

Answers (1)

Gajotres
Gajotres

Reputation: 57309

It can be done like that, take a look at this example.

In this example you have 1 page as main content and second page which will serve as a content for the dialog box.

This java script will show second page as a dialog box:

$('#test').bind('click', function(e) {
    $.mobile.changePage( "#test-dialog", {transition: "none", role: "dialog"} );
});

One more thing, I forgot you wanted a listview and I have used controlgroup, you can still replace one with another to achieve needed functionality. One more thing, unlike your example jQM dont have opacity/transparency effect around dialog box.

Upvotes: 2

Related Questions