O'Reilly logo

PhoneGap Mobile Application Development Cookbook by Matt Gifford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating element styles

As we build our applications and apply a number of styles and properties to define the layout and visual representation of elements, we also need to be able to update and alter the aesthetics and styles to reflect changes or events within the application.

How to do it...

In this recipe we will read, write, and detect the style properties and class attributes assigned to selected elements using XUI's built-in style functions.

  1. Create the initial HTML layout for the application. Include the Cordova and XUI JavaScript libraries within the head of the document.
  2. Write a new script tag block before the closing head tag, which will hold our custom PhoneGap application code. Define an empty onLoad function inside the script block.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required