Author: admin
-
Integration with RESTful Services
Most social media sites have a public API for accessing their data. Twitter,1 LinkedIn,2 and Facebook3 integrations are very common on the Web and RESTful integrations are common access strategies for each of them. In this section, we are going to integrate jQuery Mobile with two different RESTful APIs so we can see how well this strategy runs…
-
Properties
jQuery Mobile also exposes a set of properties that are publicly available so you do not have to write your own jQuery selectors to access common components. $.mobile.activePageGets the page or dialog element that is the currently active or visible. The active page is assigned the CSS class as specified by $.mobile.activePageClass. $.mobile.firstPageThis is the…
-
Trigger Events
Triggering jQuery Mobile page events can be helpful when building dynamic pages. For instance, if you add several new components to a page you can call the create event to enhance all new widgets on the page at once.
-
Events
jQuery Mobile also exposes several events that are helpful when you need to programmatically apply pre or post processing during page changes within your Mobile Web application. In this section we will review the complete list of jQuery Mobile page events that you may bind to in your own code. For an introduction of the…
-
Methods
jQuery Mobile exposes a suite of methods that are helpful when you need to programmatically update your Mobile Web application.
-
Configurable jQuery Mobile Options
The following are configurable $.mobile options you may override within your custom JavaScript. CopycopyHighlighthighlightAdd NotenoteGet Linklink
-
Custom Script Placement
Since mobileinit gets triggered immediately upon execution of jQuery Mobile, you need to place your custom script before the jQuery Mobile JavaScript file. Example: Configurable jQuery Mobile Options The following are configurable $.mobile options you may override within your custom JavaScript. CopycopyHighlighthighlightAdd NotenoteGet Linklink
-
Configuring jQuery Mobile
When jQuery Mobile initializes, it triggers a mobileinit event on the document object. You can bind to the mobileinit event and apply overrides to jQuery Mobile’s ($.mobile) default configuration settings. In addition, you can extend jQuery Mobile with additional behavior and properties. For instance, there are two ways to configure jQuery Mobile as shown in the examples below. You can either…
-
Swatch and Global Settings
You can quickly adjust the CSS attributes that apply globally to all swatches under the “Global” tab that appears in the left pane. Here you can adjust the font family, active state colors, corner radii, icons, and shadows (see Figure 7–15). Figure 7–15. Global Theme Settings Next to the “Global” tab are the swatch specific tabs (a-z).…
-
ThemeRoller
ThemeRoller4 is a web-based tool that helps automate the process of generating new CSS-based themes for jQuery Mobile. This is a very helpful tool because it allows you to make color scheme updates in the left pane and preview the results in the right pane within an actual jQuery Mobile layout (see Figure 7–14). Figure 7–14. ThemeRoller ____________________…