Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I fix the width and the height of jQueryMobile dialog?

Can I fix the width and the height of jQueryMobile dialog? Currently, the size of width is 100% which is really awful in iPad.

like image 293
PPShein Avatar asked May 09 '11 13:05

PPShein


People also ask

How to set width and height of dialog in jQuery?

$( ". selector" ). dialog({ width : 120 });

How make jQuery ui dialog responsive?

Below is how I achieved a responsive jQuery UI Dialog. To do this, I added a new option to the config - fluid: true , which says to make the dialog responsive. I then catch the resize and dialog open events, to change the max-width of the dialog on the fly, and reposition the dialog.


1 Answers

You can set the page width of the dialog, Live example: http://jsfiddle.net/bXPTd/3/

<div data-role="page" id="bar">
   <a href="#foo" data-role="button" data-inline="true" data-rel="dialog" data-transition="pop">Open dialog</a>  

</div>

<div data-role="page" id="foo" style="width:300px;">
    Hello Foo
    <a href="#" data-role="button" data-rel="back">Close dialog</a>
</div>
like image 67
Phill Pafford Avatar answered Sep 28 '22 10:09

Phill Pafford