Loader Widgetversion added: 1.2
Description: Handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax.
The Loader Widget
The loader widget handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax. The loader dialog was previously configured globally with three settings $.mobile.loadingMessage
, $.mobile.loadingMessageTextVisible
, and $.mobile.loadingMessageTheme
which are now deprecated. In addition to the methods for showing and hiding, $.mobile.showPageLoadingMsg
and $.mobile.hidePageLoadingMsg
are also deprecated.
The loader widget handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax. It can also be displayed manually for custom loading actions using the $.mobile.loading
helper method (See the global method docs).
To configure the loading dialog globally the following settings can be defined on its prototype during the mobileinit
event.
1
2
3
4
5
6
|
|
These settings will be overridden by the deprecated settings to preserve backward compatibility. Once the deprecated settings are removed these defaults will only be superseded by the method params object described in the global method docs under $.mobile.loading
.
1
2
3
4
5
6
|
|
Options
html
""
Initialize the loading with the html
option specified:
1
2
3
|
|
Get or set the html
option, after initialization:
1
2
3
4
5
|
|
text
loading
Initialize the loading with the text
option specified:
1
2
3
|
|
Get or set the text
option, after initialization:
1
2
3
4
5
|
|
textVisible
false
Initialize the loading with the textVisible
option specified:
1
2
3
|
|
Get or set the textVisible
option, after initialization:
1
2
3
4
5
|
|
textonly
false
Initialize the loading with the textonly
option specified:
1
2
3
|
|
Get or set the textonly
option, after initialization:
1
2
3
4
5
|
|
theme
a
Initialize the loading with the theme
option specified:
1
2
3
|
|
Get or set the theme
option, after initialization:
1
2
3
4
5
|
|
Methods
checkLoaderPosition()Returns: jQuery (plugin only)
- This method does not accept any arguments.
Invoke the checkLoaderPosition method:
1
|
|
fakeFixLoader()Returns: jQuery (plugin only)
- This method does not accept any arguments.
Invoke the fakeFixLoader method:
1
|
|
hide()Returns: jQuery (plugin only)
- This method does not accept any arguments.
Invoke the hide method:
1
|
|
hidePageLoadingMsg()Returns: jQuery (plugin only)
Deprecated in 1.2 - use $.mobile.loading( "hide" )
instead, see examples above
1
2
|
|
- This method does not accept any arguments.
Invoke the hidePageLoadingMsg method:
1
|
|
loading()Returns: jQuery (plugin only)
$.mobile.loader
prototype options as described in the widget docs or can be controlled via a params object.
- This method does not accept any arguments.
Invoke the loading method:
1
|
|
resetHtml()Returns: jQuery (plugin only)
- This method does not accept any arguments.
Invoke the resetHtml method:
1
|
|
show()Returns: jQuery (plugin only)
- This method does not accept any arguments.
Invoke the show method:
1
|
|
showPageLoadingMsg()Returns: jQuery (plugin only)
Deprecated in 1.2 - use $.mobile.loading( "show" )
instead, see examples above
1
2
3
4
5
|
|
- This method does not accept any arguments.
Invoke the showPageLoadingMsg method:
1
|
|
Events
create( event, ui )Type: loadingcreate
Note: The ui
object is empty but included for consistency with other events.
Initialize the loading with the create callback specified:
1
2
3
|
|
Bind an event listener to the loadingcreate event:
1
|
|
Example:
Loader Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
|