5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery Mobile Docs - Popup panels</title>
7 <link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css" />
8 <link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
10 <script src="../../../js/jquery.js"></script>
11 <script src="../../../docs/_assets/js/jqm-docs.js"></script>
12 <script src="../../../js/"></script>
14 <script src="popup-examples.js"></script>
15 <link rel="stylesheet" href="popup-examples.css" />
20 <div data-role="page" class="type-interior">
22 <div data-role="header" data-theme="f">
24 <a href="../../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
25 <a href="../../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
26 </div><!-- /header -->
28 <div data-role="content" class="ui-body">
29 <div class="content-primary">
31 <a href="index.html" data-role="button" data-transition="fade" data-icon="arrow-l" data-inline="true" data-mini="true">Back to Popups</a>
32 <h2>Overlay panels</h2>
34 <p>Taking customization further, here is an example of a popup that has been customized to look like a vertical panel with three mini buttons:</p>
36 <a href="#popupPanel" data-rel="popup" data-transition="slide" data-position-to="window" data-role="button" data-theme="b" data-inline="true">Open panel</a>
38 <div data-role="popup" id="popupPanel" data-corners="false" data-theme="none" data-shadow="false" data-tolerance="0,0">
39 <button data-theme="a" data-icon="back" data-mini="true">Back</button>
40 <button data-theme="a" data-icon="grid" data-mini="true">Menu</button>
41 <button data-theme="a" data-icon="search" data-mini="true">Search</button>
44 <p>Here is the HTML markup for the button and panel:</p>
46 <a href="#popupPanel" data-rel="popup" data-transition="slide" data-position-to="window" data-role="button">Open panel</a>
48 <div data-role="popup" id="popupPanel" data-corners="false" data-theme="none" data-shadow="false" data-tolerance="0,0">
50 <button data-theme="a" data-icon="back" data-mini="true">Back</button>
51 <button data-theme="a" data-icon="grid" data-mini="true">Menu</button>
52 <button data-theme="a" data-icon="search" data-mini="true">Search</button>
57 <p>To style the panel, and attach it to the right edge, the following CSS is used. Note that <code>#popupPanel-popup</code> is the ID of the container div generated by the framework.</p>
61 left: auto !important;
65 border: 1px solid #000;
67 background: rgba(0,0,0,.5);
75 <p>Because the popup container is positioned absolute, you can't make the panel full height with <code>height:100%;</code>. This small script sets the height of the popup to the actual screen height.</p>
77 $( "#popupPanel" ).on({
78 popupbeforeposition: function() {
79 var h = $( window ).height();
81 $( "#popupPanel" ).css( "height", h );
87 </div><!--/content-primary -->
89 <div class="content-secondary">
91 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
93 <h3>More in this section</h3>
95 <ul data-role="listview" data-theme="c" data-dividertheme="d">
97 <li data-role="list-divider">Pages & Dialogs</li>
98 <li><a href="../page-anatomy.html">Anatomy of a page</a></li>
99 <li><a href="../page-template.html" data-ajax="false">Single page template</a></li>
100 <li><a href="../multipage-template.html" data-ajax="false">Multi-page template</a></li>
101 <li><a href="../page-titles.html">Page titles</a></li>
102 <li><a href="../page-links.html">Linking pages</a></li>
103 <li><a href="../page-transitions.html" data-ajax="false">Page transitions</a></li>
104 <li><a href="../loader.html">Page loading widget</a></li>
105 <li><a href="../dialog/index.html">Dialogs</a></li>
106 <li data-theme="a"><a href="index.html">Popups</a></li>
107 <li><a href="../page-cache.html">Prefetching & caching pages</a></li>
108 <li><a href="../page-navmodel.html">Ajax, hashes & history</a></li>
109 <li><a href="../page-dynamic.html">Dynamically Injecting Pages</a></li>
110 <li><a href="../page-scripting.html">Scripting pages</a></li>
111 <li><a href="../phonegap.html">PhoneGap apps</a></li>
112 <li><a href="../touchoverflow.html">touchOverflow feature</a></li>
113 <li><a href="../pages-themes.html">Theming pages</a></li>
119 </div><!-- /content -->
121 <div data-role="footer" class="footer-docs" data-theme="c">
122 <p class="jqm-version"></p>
123 <p>© 2012 jQuery Foundation and other contributors</p>