php - How to create multiple pages? -
i using jquery mobile 1.4.2.
i want create page this:
i have create page login>delivery>payement.(its 3 step process) when complete login section goes delivery section.
- what want know whether have place contents in single .php file or should create separate .php files login,delivery,payment.
2.how create login>delivery>payement headings.
please me this.
you need create mix of everything.
first need use multi page template every page inside 1 html. important top toolbar.
if can see correctly top toolbar has 3 sections. in case need have 1 header 3 separate pages. give impression user working only 1 page. have 1 header, spend less time changing css.
that 1 header have 3 separate parts. can use navigation widget (without icons) or create yourself. , depending on active page change navigation segment background.
examples:
- make header/footer not changing while content changes: http://demos.jquerymobile.com/1.2.1/docs/toolbars/footer-persist-a.html
- working example: how keep same header/footer across pages in jquerymobile?
- jquery mobile 1.4 implementation looks this: http://api.jquerymobile.com/toolbar/
inner content should have tabs, 1 tab account , second 1 guest user.
example:
working example
basically need this: http://jsfiddle.net/cy55u/1/
swipe example see how moves between pages.
html:
<!doctype html> <html> <head> <title>jqm complex demo</title> <meta http-equiv='content-type' content='text/html; charset=utf-8'/> <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.4.2/jquery.mobile-1.4.2.min.css" /> <!--<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>--> <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> </head> <body> <div data-role="header" id="shared-header"> <h3> header </h3> </div> <div data-role="page" id="index" data-theme="a" > <div data-role="content"> <div data-role="tabs" id="tabs"> <div data-role="navbar"> <ul> <li><a href="#one" data-ajax="false">one</a></li> <li><a href="#two" data-ajax="false">two</a></li> <li><a href="ajax-content.html" data-ajax="false">three</a></li> </ul> </div> <div id="one" class="ui-body-d ui-content"> <h1>first tab contents</h1> </div> <div id="two"> <ul data-role="listview" data-inset="true"> <li><a href="#">acura</a></li> <li><a href="#">audi</a></li> <li><a href="#">bmw</a></li> <li><a href="#">cadillac</a></li> <li><a href="#">ferrari</a></li> </ul> </div> </div> </div> </div> <div data-role="page" id="second" data-theme="a" > <div data-role="content"> page 2 </div> </div> </body> </html>
javascript:
$(function () { $("[data-role=header]").enhancewithin().toolbar(); }); $(document).off('swipeleft').on('swipeleft', 'div[data-role="page"]', function(event){ if(event.handled !== true) // prevent event triggering more once { var nextpage = $.mobile.activepage.next('div[data-role="page"]'); // swipe using id of next page if exists if (nextpage.length > 0) { $( ":mobile-pagecontainer" ).pagecontainer( "change", nextpage,{transition: "slide"}); } event.handled = true; } return false; }); $(document).off('swiperight').on('swiperight', 'div[data-role="page"]', function(event){ if(event.handled !== true) // prevent event triggering more once { var prevpage = $(this).prev('div[data-role="page"]'); if (prevpage.length > 0) { $( ":mobile-pagecontainer" ).pagecontainer( "change", prevpage,{transition: "slide", reverse: true}); } event.handled = true; } return false; });
Comments
Post a Comment