Skip to content

Commit a5e839a

Browse files
committed
rewrote parts of the guide to make it more compliant with the learn site
1 parent 49a3aea commit a5e839a

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

page/jquery-mobile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
title: jQuery Mobile
33
---
44

5-
jQuery Mobile provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions.
5+
jQuery Mobile is the easiest way to build sites and apps that are accessible on all popular smartphone, tablet and desktop devices. This frameworks provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions.
66

page/jquery-mobile/getting-started.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ title: Getting Started with jQuery Mobile
33
level: Beginner
44
---
55

6+
jQuery Mobile provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions. This guide will show you how you can build your first jQuery Mobile application.
7+
68
## Create a basic page template
79

8-
Pop open your favorite text editor, paste in the page template below, save and open in a browser. You are now a mobile developer!
10+
To get started, you can simply paste the template below in your favorite text editor, save and open the document in a browser.
911

10-
Here's what's in the template. In the `head`, a meta `viewport` tag sets the screen width to the pixel width of the device and references to jQuery, jQuery Mobile and the mobile theme stylesheet from the CDN add all the styles and scripts. jQuery Mobile 1.2 (1.2.0) works with versions of jQuery core from 1.7.0 to 1.8.2.
12+
In the `head` of this template, a meta `viewport` tag sets the screen width to the pixel width of the device and references to jQuery, jQuery Mobile and the mobile theme stylesheet from the CDN add all the styles and scripts. jQuery Mobile 1.2 (1.2.0) works with versions of jQuery core from 1.7.0 to 1.8.2.
1113

12-
In the `body`, a div with a `data-role` of `page` is the wrapper used to delineate a page, and the header bar (`data-role="header"`) and content region (`data-role="content"`) are added inside to create a basic page (these are both optional). These `data-` attributes are HTML5 attributes used throughout jQuery Mobile to transform basic markup into an enhanced and styled widget.
14+
In the `body`, a div with a `data-role` of `page` is the wrapper used to delineate a page. A header bar (`data-role="header"`), a content region (`data-role="content"`) and a footer bar (`data-role="footer"`) are added inside to create a basic page (all three are optional). These `data-` attributes are HTML5 attributes used throughout jQuery Mobile to transform basic markup into an enhanced and styled widget.
1315

1416
```
1517
<!DOCTYPE html>
@@ -32,20 +34,24 @@ In the `body`, a div with a `data-role` of `page` is the wrapper used to delinea
3234
<p>Hello world</p>
3335
</div><!-- /content -->
3436
37+
<div data-role="footer">
38+
<h4>My Footer</h4>
39+
</div><!-- /header -->
40+
3541
</div><!-- /page -->
3642
3743
</body>
3844
</html>
3945
```
4046

4147

42-
### Add your content
48+
### Add content
4349

44-
Inside your content container, you can add any standard HTML elements - headings, lists, paragraphs, etc. You can write your own custom styles to create custom layouts by adding an additional stylesheet to the `head` after the jQuery Mobile stylesheet.
50+
The next step is to add content inside the content container. Any standard HTML elements - headings, lists, paragraphs, etc can be added. You can write your own custom styles to create custom layouts by adding an additional stylesheet to the `head` after the jQuery Mobile stylesheet.
4551

4652
### Make a listview
4753

48-
jQuery Mobile includes a diverse set of common listviews that are coded as lists with a `data-role="listview"` added. Here is a simple linked list that has a role of `listview`. We're going to make this look like an inset module by adding a `data-inset="true"` and add a dynamic search filter with the `data-filter="true"` attributes.
54+
jQuery Mobile includes a diverse set of common listviews that are coded as lists with a `data-role="listview"` added. Here is a simple linked list that has a role of `listview`. The `data-inset="true"` attribute makes the listview look like an inset module, while `data-filter="true"` adds a dynamic search filter.
4955

5056
```
5157
<ul data-role="listview" data-inset="true" data-filter="true">
@@ -59,37 +65,39 @@ jQuery Mobile includes a diverse set of common listviews that are coded as lists
5965

6066
### Add a slider
6167

62-
The framework contains a full set of form elements that automatically are enhanced into touch-friendly styled widgets. Here's a slider made with the new HTML5 input type of range, no `data-role` needed. Be sure to wrap these in a `form` element and always properly associate a `label` to every form element.
68+
The framework contains a full set of form elements that automatically are enhanced into touch-friendly styled widgets. Here's a slider made with the new HTML5 input type of range, no `data-role` needed. These must be wrapped in a `form` element and each of these must always be properly associated with a `label`.
6369

6470
```
6571
<form>
6672
<label for="slider-0">Input slider:</label>
6773
<input type="range" name="slider" id="slider-0" value="25" min="0" max="100" />
6874
</form>
6975
```
70-
Input slider:
76+
7177
### Make a button
7278

73-
There are a few ways to make buttons, but let's turn a link into a button so it's easy to click. Just start with a link and add a `data-role="button"` attribute to it. You can add an icon with the `data-icon` attribute and optionally set its position with the `data-iconpos` attribute.
79+
There are a few ways to make buttons. A common one is to turn a link into a button so it's easy to click. Just start with a link and add a `data-role="button"` attribute to it. You can add an icon with the `data-icon` attribute and optionally set its position with the `data-iconpos` attribute.
7480

7581
```
7682
<a href="#" data-role="button" data-icon="star">Star button</a>
7783
```
7884

79-
### Play with theme swatches
85+
### Choose a theme swatch
8086

81-
jQuery Mobile has a robust theme framework that supports up to 26 sets of toolbar, content and button colors, called a "swatch". Just add a `data-theme="e"` attribute to any of the widgets on this page: page, header, list, input for the slider, or button to turn it yellow. Try different swatch letters in default theme from a-e to mix and match swatches.
87+
jQuery Mobile has a robust theme framework that supports up to 26 sets of toolbar, content and button colors, called a "swatch". You can add a `data-theme="e"` attribute to any of the widgets on this page: page, header, list, input for the slider, or button to turn it yellow. Different swatch letters in default theme from a-e can be used to mix and match swatches.
8288

83-
Cool party trick: add the theme swatch to the page and see how all the widgets inside the content will automatically inherit the theme (headers and footers don't inherit, they default to swatch "a").
89+
If you add the theme swatch to the page, all the widgets inside the content will automatically inherit the theme (headers and footers don't inherit, they default to swatch "a").
8490

8591
```
8692
<a href="#" data-role="button" data-icon="star" data-theme="a">Button</a>
8793
```
94+
8895
When you're ready to build a custom theme, use ThemeRoller to drag and drop, then download a custom theme.
8996

90-
### Go forth and build stuff
97+
### Go forth and build something
9198

92-
This is just scratching the surface of all the cool things you can build with jQuery Mobile with little effort. Be sure to explore linking pages, adding animated page transitions, and creating dialogs. Use the data-attribute reference to try out some of the other `data-` attributes you can play with.
99+
This guide has provided you with a basic structure for a jQuery Mobile page and a few enhanced elements. You can explore the full jQuery Mobile documentation for linking pages, adding animated page transitions, and creating dialogs and popups.
93100

94-
More of a developer? Great, forget everything we just covered (kidding). If you don't want to use the `data-` attribute configuration system, you can take full control of everything and call plugins directly because these are all just standard jQuery plugins built with the UI widget factory. Be sure to dig into global configuration, events, and methods. Then read up on scripting pages, generating dynamic pages, and building PhoneGap apps.
101+
If you're more of the type who prefers actually writing JavaScript to build your apps, and you don't want to use the `data-` attribute configuration system, you can take full control of everything and call plugins directly because these are all just standard jQuery plugins built with the UI widget factory. Be sure to dig into global configuration, events, and methods.
95102

103+
Finally, you can read up on scripting pages, generating dynamic pages, and building PhoneGap apps.

0 commit comments

Comments
 (0)