Book Image

jQuery Mobile First Look

Book Image

jQuery Mobile First Look

Overview of this book

Table of Contents (17 chapters)
jQuery Mobile First Look
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Dialogs: creation, deletion, and behavior


As simple as it sounds, a dialog is nothing but a standard page styled differently: the jQuery Mobile documentation points out that "the framework adds styles to add rounded corners, margins around the page and a dark background to make the dialog appear to be suspended above the page".

To create a dialog, we just have to specify the data-rel="dialog" attribute in the link, pretty much like the following example:

<a href="dialog.html" data-rel="dialog">Dialog!</a>

As dialogs are standard pages, the default slide transition (or whatever you changed it to) will be used, unless we do not specify otherwise:

<a href="dialog.html" data-rel="dialog" data-transition="pop">Dialog!</a>

Usually, the pop transition is used as the standard dialog transition due to the animation, which looks like a new window is, well, popping up.

Note

Links that create dialogs use the $.mobile.changePage function to open a page without updating the hash, which...