Advertisement
maurobaraldi

Mobile Menu Slider Working

May 20th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 8.34 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.     <meta charset="utf-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.     <title>jQuery Mobile Demos - Slide Panel</title>
  8.     <link rel="stylesheet"  href="http://jquerymobile.com/demos/1.3.0-beta.1/css/themes/default/jquery.mobile-1.3.0-beta.1.css">
  9.     <link rel="stylesheet" href="http://jquerymobile.com/demos/1.3.0-beta.1/docs/demos/_assets/css/jqm-demos.css">
  10.     <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
  11.     <script src="http://jquerymobile.com/demos/1.3.0-beta.1/docs/demos/_assets/js/jquery.mobile.demos.js"></script>
  12.     <script src="http://jquerymobile.com/demos/1.3.0-beta.1/js/jquery.mobile-1.3.0-beta.1.js"></script>
  13. </head>
  14.     <body>
  15.         <div data-role="page" class="ui-responsive-panel">
  16.  
  17.             <div data-role="header" data-theme="f">
  18.                 <h1>My App</h1>
  19.                 <a href="#nav-panel" data-icon="bars" data-iconpos="notext">Menu</a>
  20.                 <a href="#add-form" data-icon="plus" data-iconpos="notext">Add</a>
  21.             </div><!-- /header -->
  22.             <div data-role="content">
  23.                 <h2>Panel: Menu + form</h2>
  24.  
  25.                 <p>This is a typical page that has two buttons in the header bar that open panels. The left button opens a left menu with the reveal display mode. The right button opens a form in a right overlay panel.</p>
  26.                
  27.                 <p>Since the panel links are in the top bar, there really isn't a need for the fixed positioning feature on the panel since you will always be scrolled to the top of the page. The fixed positioning impacts animation smoothness so it's off in this demo (<code>data-position-fixed="false"</code>) and the panel will scroll with the page.</p>
  28.                
  29.                 <p>To make this responsive, the left panel stays open and causes the page to re-flow at wider widths. This allows both the menu and page to be used together when more space is available. This behavior is controlled by CSS media queries. You can create a custom one for a specific breakpoint or use the breakpoint preset by adding the <code> class="ui-responsive-panel"</code> to the page container.</p>
  30.  
  31.             </div><!-- /content -->
  32.  
  33.             <div class="jqm-footer">
  34.                 <p class="jqm-version"></p>
  35.                 <p>&copy; 2010, 2013 jQuery Foundation and other contributors</p>
  36.             </div><!-- /jqm-footer -->
  37.            
  38.            
  39.             <style>
  40.                 .nav-search .ui-btn-up-a {
  41.                     background-image:none;
  42.                     background-color:#333333;
  43.                 }
  44.                 .nav-search .ui-btn-inner {
  45.                     border-top: 1px solid #888;
  46.                     border-color: rgba(255, 255, 255, .1);
  47.                 }
  48.             </style>
  49.  
  50.                 <div data-role="panel" data-position="left" data-position-fixed="false" data-display="reveal" id="nav-panel" data-theme="a">
  51.  
  52.                     <ul data-role="listview" data-theme="a" data-divider-theme="a" style="margin-top:-16px;" class="nav-search">
  53.                         <li data-icon="delete" style="background-color:#111;">
  54.                             <a href="#" data-rel="close">Close menu</a>
  55.                         </li>
  56.                         <li data-filtertext="wai-aria voiceover accessibility screen reader">
  57.                             <a href="../about/accessibility.html">Accessibility</a>
  58.                         </li>
  59.                         <li data-filtertext="accordions collapsible set collapsible-set collapsed">
  60.                             <a href="../content/content-collapsible-set.html">Accordions</a>
  61.                         </li>
  62.                         <li data-filtertext="ajax navigation model">
  63.                             <a href="../pages/page-navmodel.html">Ajax navigation model</a>
  64.                         </li>
  65.                         <li data-filtertext="anatomy of page viewport">
  66.                             <a href="../pages/page-anatomy.html">Anatomy of a page</a>
  67.                         </li>
  68.                         <li data-filtertext="events api animationComplete transition css">
  69.                             <a href="../api/events.html">Animation events</a>
  70.                         </li>
  71.                         <li data-filtertext="listview autodivider">
  72.                             <a href="../lists/lists-autodividers.html">Automatic listview dividers</a>
  73.                         </li>
  74.                         <li data-filtertext="button link submit cancel image reset mini buttonmarkup enable disable">
  75.                             <a href="../buttons/buttons-types.html">Buttons</a>
  76.                         </li>
  77.                         <li data-filtertext="button icon">
  78.                             <a href="../buttons/buttons-icons.html">Button icons</a>
  79.                         </li>
  80.                         <li data-filtertext="data-prefetch loadpage domCache data-dom-cache size clear cleanup pagehide lazyload spinner loader">
  81.                             <a href="../pages/page-cache.html">Caching pages</a>
  82.                         </li>
  83.                         <li data-filtertext="input forms multi select checkbox checks grouped horizontal toggle legend">
  84.                             <a href="../forms/checkboxes/">Checkbox</a>
  85.                         </li>
  86.                         <li data-filtertext="button icon">
  87.                             <a href="buttons/buttons-icons.html">Button icons</a>
  88.                         </li>
  89.                         <li data-filtertext="data-prefetch loadpage domCache data-dom-cache size clear cleanup pagehide lazyload spinner loader">
  90.                             <a href="../pages/page-cache.html">Caching pages</a>
  91.                         </li>
  92.                         <li data-filtertext="input forms multi select checkbox checks grouped horizontal toggle legend">
  93.                             <a href="../forms/checkboxes/">Checkbox</a>
  94.                         </li>
  95.                     </ul>
  96.  
  97.                     <!-- panel content goes here -->
  98.                 </div><!-- /panel -->
  99.  
  100.                 <style>
  101.                     .userform { padding:.8em 1.2em; }
  102.                     .userform h2 { color:#555; margin:0.3em 0 .8em 0; padding-bottom:.5em; border-bottom:1px solid rgba(0,0,0,.1); }
  103.                     .userform label { display:block; margin-top:1.2em; }
  104.                     .switch .ui-slider-switch { width: 6.5em !important }
  105.                     .ui-grid-a { margin-top:1em; padding-top:.8em; margin-top:1.4em; border-top:1px solid rgba(0,0,0,.1); }
  106.                 </style>
  107.  
  108.                 <div data-role="panel" data-position="right" data-position-fixed="false" data-display="overlay" id="add-form" data-theme="b">
  109.  
  110.                     <form class="userform">
  111.                         <h2>Create new user</h2>
  112.                         <label for="name">Name</label>
  113.                         <input type="text" name="name" id="name" value="" data-clear-btn="true" data-mini="true">
  114.  
  115.                         <label for="email">Email</label>
  116.                         <input type="email" name="email" id="status" value="" data-clear-btn="true" data-mini="true">
  117.  
  118.                         <label for="password">Password:</label>
  119.                         <input type="password" name="password" id="password" value="" data-clear-btn="true" autocomplete="off" data-mini="true">
  120.  
  121.                         <div class="switch">
  122.                         <label for="status">Status</label>
  123.                         <select name="status" id="slider" data-role="slider" data-mini="true">
  124.                             <option value="off">Inactive</option>
  125.                             <option value="on">Active</option>
  126.                         </select>
  127.                         </div>
  128.  
  129.                         <div class="ui-grid-a">
  130.                             <div class="ui-block-a"><a href="#" data-rel="close" data-role="button" data-theme="c" data-mini="true">Cancel</a></div>
  131.                             <div class="ui-block-b"><a href="#" data-rel="close" data-role="button" data-theme="b" data-mini="true">Save</a></div>
  132.                         </div>
  133.                     </form>
  134.  
  135.                     <!-- panel content goes here -->
  136.                 </div><!-- /panel -->
  137.                
  138.         </div><!-- /page -->
  139.     </body>
  140. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement