Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Fireworks Developer Center /

Creating jQuery Mobile website themes in Fireworks

by Michael Dominic

Michael Dominic
  • Adobe

Content

  • Working with the jQuery Mobile framework
  • Creating and modifying a jQuery theme template
  • Generating jQuery CSS and sprites
  • Where to go from here

Modified

7 May 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
CSS3 Dreamweaver Fireworks jQuery mobile prototyping templates

Requirements

Prerequisite knowledge

Basic familiarity working with Dreamweaver and Fireworks is required. Prior experience building websites with the jQuery Mobile Framework, HTML, and CSS is also recommended.

User level

Intermediate

Required products

  • Fireworks CSS3 Mobile Pack
  • Fireworks (Download trial)
  • Dreamweaver (Download trial)

In this article you'll learn how to work with Adobe Fireworks CS6 to create custom jQuery mobile skins and use them in mobile websites based on the jQuery Mobile Framework.

jQuery Mobile Theme Skinning feature enables you to create custom themes or icons using the jQuery template provided within Fireworks. After modifying the jQuery Mobile themes in Fireworks, you can preview it and export the corresponding CSS code and related sprite assets. This article describes how to work with the jQuery Mobile Theme Skinning feature provided by Fireworks.

Working with the jQuery Mobile framework

The jQuery Mobile Framework is a JavaScript framework that allows you to quickly build websites for mobile devices. It is a touch-optimized web framework designed for smartphones and tablets. jQuery Mobile works on the vast majority of all modern desktop, smartphone, tablet, and e-reader platforms. The jQuery Mobile Framework is easy to use and includes web-specific controls such as buttons, sliders, list elements, and many more. When you build mobile websites with the jQuery Mobile Framework you can leverage the default theme provided with the framework.

The jQuery Mobile theme skinning feature enhances the Fireworks workspace to enable you to create custom themes or modify the default jQuery Mobile theme. It also allows to add additional icons or modify the default set of icons used in jQuery Mobile. It generates associated CSS style sheet and sprite assets. You can use the CSS generated by Fireworks to modify the default theme for jQuery Mobile pages to customize it for your projects.

This article describes how you can change or create jQuery Mobile themes using Fireworks and how to apply the new or updated themes to your jQuery Mobile pages.

Without this feature, you have to manually create or modify the CSS styles for jQuery Mobile web pages. You should know the classes that need modification. You should also know the specific class names for applying styles to jQuery webpage elements. Also, it wasn't possible to preview the site to check the appearance of the theme on the website. It was rather time-consuming because you had to switch between modifying the code on a web page and then previewing it in a browser until the desired theme changes are finalized. Also, it was not possible to include additional icons to the sprites or modify existing sprites.

This feature in Fireworks helps save time because you can now modify the default swatches or create new swatches.  You can also modify the default icons or include additional icons using the template provided in Fireworks, preview it, and then generate the CSS style sheet and spritesto be used in the jQuery web page. When you apply the CSS code to your jQuery-based web pages for mobile devices, the theme is displayed exactly as it was when you previewed the design in Fireworks.

Using the jQuery Mobile Framework to design mobile sites

Every layout and widget included in jQuery Mobile is designed around a new object-oriented CSS framework. The framework makes it possible to apply a complete unified visual design theme to mobile sites and applications.

Consider the following benefits:

  • jQuery Mobile uses CSS3 properties to create rounded corners, box and text shadows, and gradients. Using CSS3 properties instead of images is advantageous because it reduces the size of the theme file and the number of server requests.
  • Themes include multiple color swatches—each consisting of a header bar, content body, and button states—that you can freely mix and match. These swatches enable you to create visual textures and richer designs.
  • Open-ended themes support up to 26 unique swatches per theme. This makes it possible to add almost unlimited variety to your designs.
  • All backgrounds now use CSS3 gradients to dramatically reduce the file size and number of server requests to improve performance.
  • A simplified icon set includes elements most commonly used for mobile, in a sprite format to reduce image weight.

The default theme contains the following five bar styles (see Figure 1):

Figure 1. Choose from five different default bar styles in the default theme.
Figure 1. Choose from five different default bar styles in the default theme.

By default, the framework assigns the "A" swatch to all headers and footers because header and footer elements are typically visually prominent in a mobile application. To set the color of a bar to a different swatch color, add the data-theme attribute to your header or footer and set an alternate swatch letter such as "B" or "D" to apply the specified theme swatch color. The CSS code generated for a bar is shown below:

{ border:1px solid #2a2a2a; background:#111; color:#fff;font-weight:bold; text-shadow:0 -1px 1px #000; background-image:-moz-linear-gradient(top,#3c3c3c,#111); background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3c3c3c),color-stop(1,#111)); -msfilter:"progid:DXImageTransform.Microsoft.gradient(startColorStr='#3c3c3c', EndColorStr='#111111')" }

To learn more about how the default theme works, read the jQuery Mobile Framework Theme Documentation.

Creating and modifying a jQuery theme template

The jQuery Mobile theme includes some default sprite images and swatches. You can use the functionality provided by the Fireworks extension to modify the sprites and swatches. You can also create multiple swatches by duplicating an existing page and customizing a copy of it.

Begin by creating a new theme:

  1. In Fireworks CS6, choose Commands > jQuery Mobile Theme > Create New Theme to create a new theme (see Figure 2).
Figure 2. Create a new jQuery Mobile theme.
Figure 2. Create a new jQuery Mobile theme.

The page name is used to name the swatch. We recommend that you use a single character (a–z) when naming pages. You can create pages by duplicating existing pages and modifying the theme according to the requirement. Each page generates a unique CSS swatch.

The template contains the default sprites and related assets (see Figure 3).

Figure 3. Default sprites and related assets.
Figure 3. Default sprites and related assets.

Custom icons can be included to the existing set of sprites. To include additional icons, add icon placeholders to the default jQuery template. After adding placeholders, create icon artwork for different resolutions and color schemes.

Creating icon placeholders

  1. Click Commands > jQuery Mobile Theme > Insert Icon Placeholders.
Figure 4. Enter an icon name
Figure 4. Enter an icon name
  1. Enter the icon name and click OK.
    Four placeholders are added for the icon in the Global Assets and Style page.
  2. Click the Hide Slices option in the Tools bar.
  3. Create artwork for icons and add them in the placeholders.
Figure 5. Create artwork for icons and add them in the placeholders.
Figure 5. Create artwork for icons and add them in the placeholders.

Modifying a jQuery Mobile template

Using Fireworks, you can modify the skin based on the theme to match a site's design.

Follow these steps to modify an existing template to update it:

  1. Open a page in Fireworks and select the desired elements.
  2. Modify individual elements on the canvas. (For example, you can update colors, change text styles, add gradient fill, adjust the degree of rounded corners, apply effects such as drop shadows, or make other updates as desired.)
  3. Save the changes by choosing File > Save.

Each object on the canvas corresponds to a section of CSS code in a swatch. The code is indicated by the title of each object (see Figure 6).

Figure 6. Fireworks document after modifying the page.
Figure 6. Fireworks document after modifying the page.

After making changes, the next step involves reviewing the recent changes to see how the design appears.

Previewing changes applied to a jQuery Mobile template

Follow these steps to preview the revised template file:

  1. Select Windows > Extensions > jQuery Mobile Theme In-App Preview (see Figure 7).
Figure 7. Choose the option to preview the theme within the Fireworks workspace.
Figure 7. Choose the option to preview the theme within the Fireworks workspace.

The Preview panel appears and displays the updated page (see Figure 8).

Figure 8. Review the updates in the jQuery Mobile Theme Preview panel.
Figure 8. Review the updates in the jQuery Mobile Theme Preview panel.
  1. To preview all themes and sprites at once in a browser, select Commands > jQuery Mobile Theme > Preview Theme in Browser (see Figure 9).
Figure 9. Preview the themes in a browser.
Figure 9. Preview the themes in a browser.

Click the tabs along the top to switch between the different themes to preview individual swatches applied to various elements.

Generating jQuery CSS and sprites

After you have created or updated a template, you can use Fireworks to generate the jQuery CSS code and the sprites for the site. Choose between one of the following two options to export the CSS swatches and sprites.

Option 1: Export both the CSS and sprites simultaneously

To export all of the swatches and sprites at once, choose Commands > jQuery Mobile Theme > Export Theme to generate the swatches and sprites for all pages (see Figure 10).

Figure 10. Choose Export Theme to generate jQuery CSS code and the related sprites.
Figure 10. Choose Export Theme to generate jQuery CSS code and the related sprites.

Option 2: Export a specific swatch or sprite individually

To export a particular swatch, click Export Current Swatch in the jQuery Mobile Theme In-App Preview panel. Use this strategy when you want to customize only the bar of a particular swatch in order to update it (see Figure 11).

Figure 11. When you choose the Export Current Swatch option, only the current element is exported and updated.
Figure 11. When you choose the Export Current Swatch option, only the current element is exported and updated.

To export only the sprite images, click Export Sprite Images in the jQuery Mobile Theme In-App Preview panel. Sprites for different resolutions and color schemes are generated. A CSS Style sheet contains displacement values for each sprite is also generated. Use this strategy when you want to include custom icons or modify existing icons in the sprite sheet.

Applying the generated CSS file to a jQuery page

At this point you've created the new CSS style sheet file to update the mobile website theme. In this section, you'll learn how to link the CSS file to your mobile website. Follow these steps:

  1. Launch Dreamweaver CS6. Open an existing site or choose File > New and choose the options in the New Document dialog box to create a blank HTML page.
  2. Choose Insert > jQuery Mobile > Page to create a jQuery Mobile page. In the jQuery Mobile Files dialog box that appears, you can link to local or remote copies of jQuery files. You are recommended to use structure and theme files separately. The structure style sheet consists of all styles except the theme. For the theme style sheet, browse to the location of the theme style sheet generated by Fireworks.
Figure 12. Link to local or remote copies of jQuery files.
Figure 12. Link to local or remote copies of jQuery files.

The page is created using the default jQuery Mobile structure style sheet and the theme file that you generated from Fireworks. It is defined in the following tags:

<link href="jquery-mobile/jquery.mobile.theme-default.css" rel="stylesheet" type="text/css" /> <link href="jquery-mobile/jquery.mobile.structure-1.0.min.css" rel="stylesheet" type="text/css" />
  1. Review the code to see how the CSS style sheet is linked to the HTML page (see Figure 13).
Figure 13. Below the title, the link tag hooks up the generic CSS style sheet file to the default jQuery HTML page in Dreamweaver.
Figure 13. Below the title, the link tag hooks up the generic CSS style sheet file to the default jQuery HTML page in Dreamweaver.
  1. In the Code window, add a link to point to the jQuery CSS style sheet that you generated using Fireworks, as defined in the following tag:
    <link href="jquery-mobile/theme_f.css" rel="stylesheet" type="text/css"/>.
    Using this strategy, you can apply the new themes you create in Fireworks to the entire page or to specific elements of the page.

For example, rather than using the default "A" bar design, you can use code to apply a different bar style, like this:

<div data-role="header" data-theme="f">

After applying these changes, click the Live View button to review how the updated theme appears within the Dreamweaver workspace (see Figure 14).

Figure 14. Click Live View to review the recent changes in Dreamweaver after editing the page to apply the new theme.
Figure 14. Click Live View to review the recent changes in Dreamweaver after editing the page to apply the new theme.

Adding an icon that you exported to a jQuery page using the jQuery Swatch panel in Dreamweaver

  1. Open the jQuery Swatch panel by clicking Window > jQuery Mobile Swatch.
  2. Select the button on which you want to add the icon.
  3. In the jQuery Mobile Swatches pop-up window, click Refresh.
  4. Select the icon that you created.
Figure 15. jQuery Mobile Swatches
Figure 15. jQuery Mobile Swatches

Adding an icon to a jQuery page

  1. Select the tag to which you want to add an icon.
  2. In the code view, to include an icon, provide the data-icon attribute in the tag as shown below (See Figure 16):

<a href=”#” data-role="button" data-icon="favorites">Button</a>

The data-icon value, “favorites”, is the name with which the icon was created in Fireworks.

For more details, see the Creating icon placeholders section above.

Figure 16. Adding data-icon attribute in the Code view
Figure 16. Adding data-icon attribute in the Code view

Note: In accordance with the jQuery Mobile Framework, Fireworks does not export patterns to optimize the size of the exported content.

Where to go from here

As you've seen in this article, you can use Fireworks to create and update jQuery Mobile website themes to build and manage websites for devices. The updated interface includes the ability to generate the CSS style sheets that you can use to redesign mobile apps and sites.

Fireworks makes it easier than ever before to build and deploy web designs across multiple screens. Additionally, since the generated CSS is cross-platform compatible, the sites you create will perform and appear as expected on smartphones and tablets. Use the preview options in Dreamweaver to review the changes in Live View or in a browser in order to check your work before publishing the changes. You can also preview inside Fireworks.

To learn more about extending Fireworks to create CSS style sheets, read Extracting CSS properties from design objects in Fireworks using the CSS3 Mobile Pack, and watch the Fireworks senior product manager, Takashi Morifusa, demonstrate the CSS3 Properties panel and jQuery Mobile theme skinning tool. Also be sure also to check out the HTML5 and CSS3 Development Center.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

More Like This

  • Designing a website application with Fireworks CS4
  • Industry trends in prototyping
  • Prototyping AIR applications with Fireworks
  • Mobile workflows using Fireworks CS5 and Device Central CS5
  • Three demos of exporting CSS and images from Fireworks
  • Prototyping for the Apple iPhone using Fireworks
  • Prebuilt CSS templates in Fireworks
  • Designing a media player skin in Fireworks
  • Rapid interactive prototyping with HTML, CSS, and JavaScript using Fireworks and Dreamweaver CS4
  • Interaction design and rapid prototyping with Fireworks

Tutorials & Samples

Tutorials

  • Creating jQuery Mobile website themes in Fireworks
  • Extracting CSS properties from Fireworks design objects
  • Working with CSS sprites in Fireworks CS6

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Fireworks Forum

More
04/19/2012 How to center multiple text in a button
04/22/2012 What exactly needs to be done to have my browser output text into a path that the user cannot type..
04/21/2012 Website Ranking
04/20/2012 Link problem with Fireworks CS5 - net::ERR_FILE_NOT_FOUND

Fireworks Cookbooks

More
09/07/2011 How do I use FXG XML markup in Shape subclasses?
10/15/2010 Flex4 Dotted Line
06/25/2010 ComboBox that uses a NativeMenu (Air API)
05/21/2010 Localizing a Creative Suite 5 extension

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement