#

Navigation Search

- Accordion
- AJAX Navigation
- Autocomplete
- Buttons
- Checkboxes
- Collapsibles
- Controlgroup
- Dialogs
- Fixed toolbars
- Flip switch toggle
- Footer toolbar
- Form elements
- Grids
- Header toolbar
- Icon
- Links
- Listviews
- Loader overlay
- Navbar
- Navbar, persistent
- Pages
- Panels New
- Popup
- Radio buttons
- Select
- Slider, single
- Slider, dual range New
- Table, column toggle New
- Table, reflow New
- Text inputs & textarea
- Transitions
- Collapsibles
- Dynamic collapsible
- Controlgroups
- Dynamic controlgroup
- Listviews
- Grid Listview
- Autodividers Linkbar
- Autodividers Selector
- Navigation
- Backbone and Require.js example
- Redirection with server-side support
- Panels
- Panel styling
- Open panel on swipe
- Popups
- Dynamic popup
- Popup with arrow
- Responsive Tables
- Reflow: Custom styles
- Reflow: Heading groups
- Column toggle: Customization options
- Column toggle: Heading groups
- Column toggle demo: Phone comparison
- Sliders
- Tooltip extension
- Swipe
- Swipe to navigate
- Swipe to delete list item
- Forms
- Why won't my CSS styles apply correctly to a widget?
- Updating the value of enhanced form elements does not work.
- My HTML 5 inputs look different across devices and browsers.
- My range or search inputs are being change to number/text.
- Sometimes my custom select shows as a popup other times its a dialog.
- Disabling a button does not work.
- Controls in my fixed header or footer are not responding or behave erratically.
- Pages
- Why aren't my scripts and styles loading?
- Why isn't DOM ready working for my scripts?
- How do I load a page?
- Why is only the first page of my multi page document loaded?
- I'm trying to pass query params to a page but it's not working?
- I'm trying to pass information via the hash but it's not working?
- I'm trying to use the application cache but it's not working?
- Content injected into a page is not enhanced.
- Triggering create on injected HTML does not work.
- How can I stop JQM from auto-enhancing an element?
- How can I stop JQM from enhancing a block of elements?
- How do I control page titles?
- How do I load a page?
- Events
- How do I use touch and mouse events?
- Apps
- How do I need to configure PhoneGap/Cordova?

# Popup API

The popup widget can be used for various types of popups. From a small tooltip popup to a large photo lightbox.

## Popup basics

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. A popup div has to be nested inside the same page as the link.

Basic Popup

This is a completely basic popup, no options set.

## Tooltip

A tooltip can be created by adding a theme swatch to a basic popup and adding padding via the `ui-content` class.

A paragraph with a tooltip. Learn more

Here is a tiny popup being used like a tooltip. The text will wrap to multiple lines as needed.

## Photo lightbox

A lightbox for displaying images can be created easily by placing an image in a popup. In this example, a close button is added to the markup by adding a link. The `data-overlay-theme="a"` attribute adds a dark backdrop behind the photos. For advanced photo techniques, see scaling images in popups.

Close
Close
Close

## Menu

A menu can be created by adding a listview inside a popup.

Actions...

- Choose an action
- View details
- Edit
- Disable
- Delete

## Nested menu

A nested menu can be created by placing listviews into an accordion inside a popup.

Choose a creature...

## Farm animals

- Chicken
- Cow
- Duck
- Sheep

## Pets

- Cat
- Dog
- Iguana
- Mouse

## Ocean Creatures

- Fish
- Octopus
- Shark
- Starfish

## Wild Animals

- Lion
- Monkey
- Tiger
- Zebra

## Form

You can place a form inside a popup. When it opens, focus will be restricted to elements inside the popup.

Sign in

### Please sign in

Username: Password:

## Dialog

Standard dialog markup can be placed into a popup. To create a modal style dialog, add the `data-dismissible="false"` attribute to the popup to prevent the click-outside-to-close behavior so people need to interact with popup buttons to close it.

Delete page...

# Delete Page?

### Are you sure you want to delete this page?

This action cannot be undone.

Cancel Delete

## Adding padding

For popups with formatted text, padding is needed. The `ui-content` class can be added to the popup to add the standard 15px of padding. When padding is added, we apply a few style rules to negate the top margin for the first heading or paragraph in the popup and do the same for the last element's bottom margin.

Popup with padding

This is a popup with the `ui-content` class added to the popup container.

## Closing popups

By default popups can be closed either by clicking outside the popup widget or by pressing the `Esc` key. To prevent this, the `data-dismissible="false"` attribute can be added to the popup. To add an explicit close button to a popup, add a link with the role of button into the popup container with a `data-rel="back"` attribute and position via a class.

Right close button Left close button Undismissible Popup
Close

I have a close button at the top right corner with simple HTML markup.

Close

I have a close button at the top left corner with simple HTML markup.

Close

I have the `data-dismissible` attribute set to `false`. I'm not closeable by clicking outside of me.

## Position

By default, popups open centered vertically and horizontally over the element you clicked (the origin) which is good for popups used as tooltips or menus. If a popup should appear centered within the window instead of over the origin, add the `data-position-to` attribute to the link and specify a value of `window`. It's also possible to specify any valid selector as the value of `position-to` in addition to `origin` and `window`.

Position to window Position to origin Position to #position-header

I am positioned to the window.

I am positioned over the origin.

I am positioned over the header for this section via a selector. If the header isn't scrolled into view, collision detection will place the popup so it's in view.

## Transitions

By default, popups have no transition to make them open as quickly as possible. To set the transition used for a popup, add the `data-transition` attribute to the link that references the popup. The reverse transition will be used when closing the popup. For performance reasons on mobile devices, we recommend using simpler transitions like pop, fade or none for smooth and fast popup animations.

No transition Pop Fade Flip Turn Flow Slide Slidefade Slide up Slide down

I'm a simple popup.

## Theme

The popup has two theme-related options: `data-theme` and `data-overlay-theme`. The `data-theme` option refers to the theme of the popup itself, whereas `data-overlay-theme` controls the semi-opaque layer behind the popup. The theme is inherited from the page; specify `data-theme="none"` for a popup with a transparent background.

Theme A

I have `data-theme="a"` set on me

Theme "none", no shadow
Close
Overlay theme A

I have a `data-overlay-theme="a"` set on me

Theme E + overlay A

I have `data-theme="e"` and `data-overlay-theme="a"` set on me

## Advanced techniques

Learn how to customize and extend popups by working with the API, custom scripts, and styles.

Scaling images Map + video iframes