javascript - Jquery mobile, creating a bar down side of page (photo's) -
i trying create sort of thin bar running down edge of page mobile app, based on jquery mobile. it's purpose alert people presence of side panel can pull out. have attached images explain point better
since jqm uses page content footer system, unclear me how this. have heard of creating sidebar content-secodary seems on kill , i've heard behaves differently on phone opposed tablets.
intro
i made few months ago, difference pull button don't have height set 100%.
this solution tested on:
- desktop chrome
- desktop firefox
- mobile android chrome
only thing need change button height.
working example
jsfiddle example can found here: http://jsfiddle.net/gajotres/qgdst/
code
html
<!doctype html> <html> <head> <title>jqm complex demo</title> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densitydpi=device-dpi"/> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" /> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> </head> <body> <div data-role="page" id="index"> <div data-theme="b" data-role="header"> <h1>index page</h1> </div> <div data-role="content"> </div> <div data-role="panel" id="left-panel" data-display="overlay" data-position="left" data-theme="c"> <img src="small_image_as_button" /><!-- click here open panel --> <nav id="indice"> <!-- content here --> </nav> <div data-role="button" id="tick-button">>></a> </div> </div> </body> </html>
javascript
$(document).on('pagebeforeshow', '#index', function(){ $(document).on('click tap', '#tick-button', function(){ $("#left-panel").panel( "open"); }); });
css:
.ui-panel-closed { visibility: visible !important; width: 100px !important; left: 160px !important; overflow: visible !important; } .ui-content { padding: 0 15px 15px 15px !important; } #tick-button { position: absolute; top: 100px; right: -27px; width: 25px; height: 100px; margin: 0 0 !important; border-radius: 0 1em 1em 0; } #tick-button .ui-btn-inner { padding: 0 0 !important; height: 100% !important; font:10px 'courier new', 'verdana',serif; line-height: 100px; color: #555; text-shadow: 1px 1px #fff; }
Comments
Post a Comment