Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 6b41a21

Browse files
Demos: Added single page template example. Fixes #5716
1 parent 7cbfa20 commit 6b41a21

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

demos/widgets/pages/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
</html>
123123
</code></pre>
124124

125+
<a href="page-template.html" class="jqm-button" data-ajax="false" data-role="button" data-inline="true" data-mini="true" data-icon="arrow-r" data-iconpos="right">View page template</a>
126+
125127
<h2>Multi-page template structure</h2>
126128

127129
<p>A single HTML document can contain multiple "pages" that are loaded together by stacking multiple divs with a <code>data-role</code> of <code>"page"</code>. Each "page" block needs a unique id (<code>id="foo"</code>) that will be used to link internally between "pages" (<code>href="#foo"</code>). When a link is clicked, the framework will look for an internal "page" with the id and transition it into view.</p>
@@ -167,8 +169,7 @@
167169
&lt;/body&gt;
168170
</code></pre>
169171

170-
<a href="multipage-template.php" class="jqm-button" data-ajax="false" data-role="button" data-inline="true" data-mini="true" data-icon="arrow-r" data-iconpos="right">View multi-page template</a>
171-
<p> </p>
172+
<a href="multipage-template.html" class="jqm-button" data-ajax="false" data-role="button" data-inline="true" data-mini="true" data-icon="arrow-r" data-iconpos="right">View multi-page template</a>
172173

173174
<p>PLEASE NOTE: Since we are using the hash to track navigation history for all the AJAX "pages", it's not currently possible to deep link to an anchor (<code>index.html#foo</code>) on a page in jQuery Mobile, because the framework will look for a "page" with an <code>id</code> of <code>#foo</code> instead of the native behavior of scrolling to the content with that <code>id</code>.</p>
174175

demos/widgets/pages/multipage-template.php renamed to demos/widgets/pages/multipage-template.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css">
99
<link rel="stylesheet" href="../../_assets/css/jqm-demos.css">
1010
<link rel="shortcut icon" href="../../favicon.ico">
11-
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
1211
<script src="../../../js/jquery.js"></script>
1312
<script src="../../_assets/js/"></script>
1413
<script src="../../../js/"></script>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>Multi-page template</title>
8+
<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css">
9+
<link rel="stylesheet" href="../../_assets/css/jqm-demos.css">
10+
<link rel="shortcut icon" href="../../favicon.ico">
11+
<script src="../../../js/jquery.js"></script>
12+
<script src="../../_assets/js/"></script>
13+
<script src="../../../js/"></script>
14+
</head>
15+
16+
<body>
17+
18+
<div data-role="page">
19+
20+
<div data-role="header">
21+
<h1>Single page</h1>
22+
</div><!-- /header -->
23+
24+
<div data-role="content">
25+
<p>This is a single page boilerplate template that you can copy to build your first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.</p>
26+
<p>Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.</p>
27+
<p>This template is standard HTML document with a single "page" container inside, unlike a <a href="multipage-template.html" data-ajax="false">multi-page template</a> that has multiple pages within it. We strongly recommend building your site or app as a series of separate pages like this because it's cleaner, more lightweight and works better without JavaScript.</p>
28+
</div><!-- /content -->
29+
30+
<div data-role="footer">
31+
<h4>Footer content</h4>
32+
</div><!-- /footer -->
33+
34+
</div><!-- /page -->
35+
36+
</body>
37+
</html>

0 commit comments

Comments
 (0)