From 0e28ffe9a17adf9e9c83b758953585036f1a1fa1 Mon Sep 17 00:00:00 2001 From: Todd Parker Date: Thu, 11 Nov 2010 14:06:47 -0500 Subject: [PATCH] Added a few code style to demo css. Converted events api page to use DL markup --- docs/_assets/css/jqm-docs.css | 7 +++- docs/api/events.html | 74 +++++++++++++++++++++++------------ 2 files changed, 56 insertions(+), 25 deletions(-) diff --git a/docs/_assets/css/jqm-docs.css b/docs/_assets/css/jqm-docs.css index ede681b1..7f148ba8 100644 --- a/docs/_assets/css/jqm-docs.css +++ b/docs/_assets/css/jqm-docs.css @@ -4,4 +4,9 @@ .ui-mobile #jqm-homeheader p { margin: 0; } .ui-mobile #jqm-version { text-indent: -99999px; background: url(../images/version.png) top right no-repeat; width: 119px; height: 122px; overflow: hidden; position: absolute; top: 0; right: 0; } .ui-mobile .jqm-themeswitcher { clear: both; margin: 20px 0 -15px; } -dt { font-weight: bold; margin-top: 2em; } \ No newline at end of file + +h2 { margin-top:2em; } +p code { font-size:1.2em; font-weight:bold; } + +dt { font-weight: bold; margin-top: 2em; } +dt code { font-size:1.3em; line-height:150%; } \ No newline at end of file diff --git a/docs/api/events.html b/docs/api/events.html index 5eee8f19..b7652bae 100755 --- a/docs/api/events.html +++ b/docs/api/events.html @@ -4,6 +4,7 @@ jQuery Mobile Docs - Events + @@ -15,28 +16,51 @@
-

New events available in jQuery Mobile

+

Events in jQuery Mobile

jQuery Mobile offers several custom events that build upon native events to create useful hooks for development. Note that these events employ various touch, mouse, and window events, depending on event existence, so you can bind to them for use in both handheld and desktop environments. You can bind to these events like you would with other jQuery events, using live() or bind().

- +
+
tap
+
Triggers after a quick, complete touch event.
+ +
taphold
+
Triggers after a held complete touch event (close to one second).
+ +
swipe
+
Triggers when a horizontal drag of 30px or more (and less than 20px vertically) occurs within 1 second duration.
+ +
swipeleft
+
Triggers when a swipe event occurred moving in the left direction.
+ +
swiperight
+
Triggers when a swipe event occurred moving in the right direction.
+ +
orientationchange
+
Triggers when a device orientation changes (by turning it vertically or horizontally). When bound to this event, your callback function can leverage a second argument, which contains an orientation property equal to either "portrait" or "landscape". These values are also added as classes to the HTML element, allowing you to leverage them in your CSS selectors. Note that we currently bind to the resize event when orientationChange is not natively supported.
+ +
scrollstart
+
Triggers when a scroll begins. Note that iOS devices freeze DOM manipulation during scroll, queuing them to apply when the scroll finishes. We're currently investigating ways to allow DOM manipulations to apply before a scroll starts.
+ +
scrollstop
+
Triggers when a scroll finishes.
+
-

Page show/hide events

+

Page show/hide events

Whenever a page is shown or hidden in jQuery Mobile, two events are triggered on that page. The events triggered depend on whether that page is being shown or hidden, so when a page transition occurs, there are actually 4 events triggered: 2 for each page.

- +
+
pagebeforeshow
+
Triggered on the page being shown, before its transition begins.
+ +
pagebeforehide
+
Triggered on the page being hidden, before its transition begins.
+ +
pageshow
+
Triggered on the page being shown, after its transition completes.
+ +
pagehide
+
Triggered on the page being hidden, after its transition completes.
+ +

Note that all four of these events expose a reference to either the next page (nextPage) or previous page (prevPage), depending on whether the page is being shown or hidden, and whether that next or previous page exists (the first ever page shown does not have a previous page to reference, but an empty jQuery object is provided just the same). You can access this reference via the second argument of a bound callback function. For example:

@@ -50,16 +74,18 @@ $('div').live('pagehide',function(event, ui){
 });
 		
 		
-

Page initialization events

+

Page initialization events

Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an input element with a type of range will automatically generate a custom slider control.

This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.

- +
+
pagebeforecreate
+
Triggered on the page being initialized, before initialization occurs.
+
pagecreate
+
Triggered on the page being initialized, after initialization occurs.
+

Note that by binding to pagebeforecreate and returning false, you can prevent the page plugin from making its manipulations.

@@ -68,7 +94,7 @@ $('div').live('pagehide',function(event, ui){
-

Animation Events

+

Animation Events

jQuery Mobile exposes the animationComplete plugin, which you can utilize after adding or removing a class that applies a CSS transition.