Skip to content

Commit 1765408

Browse files
Markus Amalthea Magnusonajpiano
authored andcommitted
Style and typography fixes and code style adherence in the jQuery UI section. Fixes #333.
1 parent 96f6894 commit 1765408

File tree

8 files changed

+416
-561
lines changed

8 files changed

+416
-561
lines changed

page/jquery-ui/getting-started.md

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,111 +4,127 @@ level: beginner
44
---
55

66
### What is jQuery UI?
7-
jQuery UI is a widget and interaction library built on top of the jQuery JavaScript Library that you can use to build highly interactive web applications. This guide is designed to get you up to speed on how jQuery UI works. Follow along below to get started.
87

9-
### Start by checking out the demos
8+
jQuery UI is a widget and interaction library built on top of the jQuery JavaScript Library that you can use to build highly interactive web applications. This guide is designed to get you up to speed on how jQuery UI works. Follow along below to get started.
9+
10+
### Start by Checking Out the Demos
11+
1012
To get a feel for what jQuery UI is capable of, check out the [UI Demos](http://jqueryui.com/demos/).
1113

1214
In the demos section, the navigation lists all of the interactions and widgets that jQuery UI offers. Choose an interaction or widget and you'll be presented with several demo configurations for that particular plugin. Each demo allows you to view source code, change themes, and the URL can always be bookmarked. For example, check out the [accordion widget's fill space demo page](http://jqueryui.com/accordion/#fillspace).
1315

14-
### Build your custom jQuery UI download
15-
Once you have a basic understanding of what jQuery UI is and what it does, you're ready to try it out! It's time to head over to the [Download Builder](http://jqueryui.com/download/) on the jQuery UI website to download a copy of jQuery UI. jQuery UI's download builder allows you to choose the components you would like to download and get a custom version of the library for your project. There are 3 easy steps to building your custom jQuery UI download:
16+
### Build Your Custom jQuery UI Download
17+
18+
Once you have a basic understanding of what jQuery UI is and what it does, you're ready to try it out! It's time to head over to the [Download Builder](http://jqueryui.com/download/) on the jQuery UI website to download a copy of jQuery UI. jQuery UI's Download Builder allows you to choose the components you would like to download and get a custom version of the library for your project. There are three easy steps to building your custom jQuery UI download:
1619

17-
#### Step 1: Choose which components you need
18-
The main column of the Download Builder lists all of the javascript components in jQuery UI categorized into groups: core, interations, widgets, and effects. Some components in jQuery UI depend on other components. Just check the boxes for the widgets you'd like to download and any required dependencies will automatically be checked as well. The components you select will all be combined into a custom jQuery UI javascript file.
20+
#### Step 1: Choose Which Components You Need
21+
22+
The main column of the Download Builder lists all of the JavaScript components in jQuery UI categorized into groups: core, interations, widgets, and effects. Some components in jQuery UI depend on other components. Just check the boxes for the widgets you'd like to download and any required dependencies will automatically be checked as well. The components you select will all be combined into a custom jQuery UI JavaScript file.
1923

2024
![Configuring a download](/resources/jquery-ui/configure.png)
2125

22-
#### Step 2: Select a theme (or roll your own custom theme)
23-
In the right column of the download builder, you'll find a field where you can choose from a number of pre-designed themes for your jQuery UI widgets.
26+
#### Step 2: Select a Theme (or Roll Your Own Custom Theme)
27+
28+
In the right column of the Download Builder, you'll find a field where you can choose from a number of pre-designed themes for your jQuery UI widgets.
2429
You can either choose from the various themes we provide, or you can design your own custom theme using ThemeRoller (more on that later).
2530

26-
**Advanced Theme Settings:** *The theme section of the download builder also offers some advanced configuration settings for your theme. If you plan to use multiple themes on a single page, these fields will come in handy. If you plan to only use one theme on a page, you can skip these settings entirely.*
31+
**Advanced Theme Settings:** *The theme section of the Download Builder also offers some advanced configuration settings for your theme. If you plan to use multiple themes on a single page, these fields will come in handy. If you plan to only use one theme on a page, you can skip these settings entirely.*
2732

28-
#### Step 3: Choose a version of jQuery UI
29-
The last step in the download builder is to select a version number. This is a very important step because jQuery UI versions are designed to work with specific versions of jQuery. The current versions are:
33+
#### Step 3: Choose a Version of jQuery UI
3034

31-
* jQuery UI 1.10.0 - Requires jQuery 1.6+
32-
* jQuery UI 1.9.2 - Requires jQuery 1.6+
35+
The last step in the Download Builder is to select a version number. This is a very important step because jQuery UI versions are designed to work with specific versions of jQuery. The current versions are:
36+
37+
* jQuery UI 1.10.2 – Requires jQuery 1.6 or later.
38+
* jQuery UI 1.9.2 – Requires jQuery 1.6 or later.
3339

3440
#### Click Download!
35-
You're finished with the download builder! Click the download button and you'll get a customized zip file containing everything you selected.
3641

37-
### After downloading: Intro to using jQuery UI
42+
You're finished with the Download Builder! Click the download button and you'll get a customized zip file containing everything you selected.
43+
44+
### After Downloading: Intro to Using jQuery UI
45+
3846
Once you've downloaded jQuery UI, you'll get a zip containing the following files:
3947

4048
* `/css/`
4149
* `/development-bundle/`
4250
* `/js/`
4351
* `index.html`
4452

45-
### Basic overview: using jQuery UI on a web page
46-
Open up index.html in a text editor and you'll see that it links to a few dependencies: your theme, jQuery, and jQuery UI. Generally, you'll need to include these 3 files on any page to use jQuery UI widgets and interactions:
53+
### Basic Overview: Using jQuery UI on a Web Page
4754

55+
Open up `index.html` in a text editor and you'll see that it links to a few dependencies: your theme, jQuery, and jQuery UI. Generally, you'll need to include these three files on any page to use jQuery UI widgets and interactions:
4856

4957
```html
50-
<link type="text/css" href="css/themename/jquery-ui.custom.css" rel="Stylesheet" />
51-
<script type="text/javascript" src="js/jquery.min.js"></script>
52-
<script type="text/javascript" src="js/jquery-ui.custom.min.js"></script>
58+
<link rel="stylesheet" href="css/themename/jquery-ui.custom.css" />
59+
<script src="js/jquery.min.js"></script>
60+
<script src="js/jquery-ui.custom.min.js"></script>
5361
```
5462

55-
Once you've included the necessary files, you can add some jQuery widgets to your page. For example, to make a datepicker widget, you'll add a text input element to your page and then call .datepicker(); on it. Like this:
63+
Once you've included the necessary files, you can add some jQuery widgets to your page. For example, to make a datepicker widget, you'll add a text input element to your page and then call `.datepicker()` on it. Like this:
5664

5765
**HTML:**
66+
5867
```html
59-
<input type="text" name="date" id="date">
68+
<input type="text" name="date" id="date" />
6069
```
6170

62-
**JS:**
71+
**JavaScript:**
72+
6373
```javascript
64-
$('#date').datepicker();
74+
$( "#date" ).datepicker();
6575
```
6676

6777
![Example Screenshot](/resources/jquery-ui/ex-datepicker.png)
6878

69-
#### That's it!
70-
For demos of all of the jQuery UI widgets and interactions. Check out the demos section of the jQuery UI website.
79+
#### That's It!
7180

72-
### Customizing jQuery UI to your needs
73-
jQuery UI allows you to customize it in several ways. You've already seen how the download builder allows you to customize your copy of jQuery UI to include only the portions you want, but there are additional ways to customize that code to your implementation.
81+
For demos of all of the jQuery UI widgets and interactions, check out the demos section of the jQuery UI website.
7482

75-
### jQuery UI basics: using options
76-
Each plugin in jQuery UI has a default configuration which is catered to the most basic and common use case. But if you want a plugin to behave different from its default configuration, you can override each of its default settings using "options". Options are a set of properties passed into a jQuery UI widget as an argument. For example, the slider widget has an option for orientation, which allows you to specify whether the slider should be horizontal or vertical. To set this option for a slider on your page, you just pass it in as an argument, like this:
83+
### Customizing jQuery UI to Your Needs
84+
85+
jQuery UI allows you to customize it in several ways. You've already seen how the Download Builder allows you to customize your copy of jQuery UI to include only the portions you want, but there are additional ways to customize that code to your implementation.
7786

87+
### jQuery UI Basics: Using Options
88+
89+
Each plugin in jQuery UI has a default configuration which is catered to the most basic and common use case. But if you want a plugin to behave different from its default configuration, you can override each of its default settings using "options". Options are a set of properties passed into a jQuery UI widget as an argument. For example, the slider widget has an option for orientation, which allows you to specify whether the slider should be horizontal or vertical. To set this option for a slider on your page, you just pass it in as an argument, like this:
7890

7991
```javascript
80-
$('#mySliderDiv').slider({
81-
orientation: 'vertical'
92+
$( "#mySliderDiv" ).slider({
93+
orientation: "vertical"
8294
});
8395
```
8496

8597
You can pass as many different options as you'd like by following each one with a comma (except the last one):
8698

8799
```javascript
88-
$('#mySliderDiv').slider({
89-
orientation: 'vertical',
90-
min: 0,
91-
max: 150,
92-
value: 50
100+
$( "#mySliderDiv" ).slider({
101+
orientation: "vertical",
102+
min: 0,
103+
max: 150,
104+
value: 50
93105
});
94106
```
95107

96108
Just remember to surround your options with curly brackets `{ }`, and you're well on your way. Of course, the example above barely touches on what you can do with jQuery UI. To get detailed information on the entire set of jQuery UI widgets, visit the [jQuery UI documentation](http://jqueryui.com/demos/).
97109

98-
### Visual customization: Designing a jQuery UI theme
99-
If you want to design your own theme, jQuery UI has a very slick application for just that purpose. It's called ThemeRoller, and you can always get to it by either clicking the "Themes" link in the jQuery UI navigation, or simply going to [jQuery UI Themeroller](http://jqueryui.com/themeroller/).
110+
### Visual Customization: Designing a jQuery UI Theme
100111

101-
ThemeRoller provides a custom interface for designing all of the elements used by jQuery UI widgets. As you tweak the "levers" in the left column, the widgets on the right will reflect your design. The Gallery tab of ThemeRoller offers a number of pre-designed themes (the same ones offered by the download builder) that you can tweak or download as they are.
112+
If you want to design your own theme, jQuery UI has a very slick application for just that purpose. It's called ThemeRoller, and you can always get to it by either clicking the "Themes" link in the jQuery UI navigation, or simply going to [jQuery UI ThemeRoller](http://jqueryui.com/themeroller/).
102113

103-
![Themeroller Example](/resources/jquery-ui/themeroller.png)
114+
ThemeRoller provides a custom interface for designing all of the elements used by jQuery UI widgets. As you tweak the "levers" in the left column, the widgets on the right will reflect your design. The Gallery tab of ThemeRoller offers a number of pre-designed themes (the same ones offered by the Download Builder) that you can tweak or download as they are.
104115

105-
### Downloading your theme
106-
When you click the "Download theme" button in ThemeRoller, you'll be directed to the Download Builder and your custom theme will be auto-selected in the Theme dropdown menu. You can configure your download package further from there. Once you download, you'll see that the example.html page is styled using your custom theme.
116+
![ThemeRoller Example](/resources/jquery-ui/themeroller.png)
107117

108-
**Quick tip:** *If you ever need to edit your theme, simply open the CSS file and find on line 43 where it says "To view and modify this theme, visit ..." That url will open the theme in ThemeRoller for editing.*
118+
### Downloading Your Theme
119+
120+
When you click the "Download theme" button in ThemeRoller, you'll be directed to the Download Builder and your custom theme will be auto-selected in the Theme dropdown menu. You can configure your download package further from there. Once you download, you'll see that the `example.html` page is styled using your custom theme.
121+
122+
**Quick Tip:** *If you ever need to edit your theme, simply open the CSS file and find on line 43 where it says "To view and modify this theme, visit ..." That url will open the theme in ThemeRoller for editing.*
123+
124+
### Support: Where Can I Get Help?
109125

110-
### Support: Where can I get help?
111126
JQuery UI user and developer resources are kept up-to-date at the [Support Center](http://jqueryui.com/support).
112127

113128
### Developers Wanted!
129+
114130
Want to join the jQuery UI team? We'd love your help! Visit the UI [Development Center](http://jqueryui.com/development) for details on how to get involved.

0 commit comments

Comments
 (0)