Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy 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
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Dreamweaver Developer Center /

Advanced design template for jQuery Mobile

by Chris Converse

Chris Converse
  • Codify Design Studio

Content

  • Flexibility through CSS
  • Combining ThemeRoller with custom CSS
  • Adding some custom jQuery scripts
  • Where to go from here

Created

18 June 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
animationCSSdesignDreamweaverdynamic websitejQuerymobilestatesstyling
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

This article assumes the reader has some knowledge of HTML and CSS.

User level

All

Required products

  • Dreamweaver CS6 (Download trial)
  • Photoshop (Download trial)

Sample files

  • template_14-jquery-mobile-app.zip

jQuery Mobile is a unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily theme-able design. Meanwhile, Adobe Dreamweaver CS6 features a streamlined workflow for creating a jQuery Mobile project. In this article, you will create a simple jQuery Mobile application with Dreamweaver CS6.

The following video walks you through the features of this Dreamweaver template for jQuery Mobile.

converse-video-still Video: Dreamweaver workflow for jQuery Mobile projects

Figure 1. See the streamlined workflow in Dreamweaver CS6 for creating a jQuery Mobile project

Figure 1. The jQuery Mobile app you will create in this tutorial.
Figure 1. The jQuery Mobile app you will create in this tutorial.

In Dreamweaver, simply select File > New > Page from Sample > jQuery Mobile with theme (local), and finally click Create. When you save this file, Dreamweaver creates all of the necessary files including all of the CSS and HTML markup, to create a basic jQuery Mobile website.

Figure 2. Creating a new mobile website in Dreamweaver CS6.
Figure 2. Creating a new mobile website in Dreamweaver CS6.

Once you have created your mobile website, you are ready to begin customizing the CSS and HTML to mold this project into your desired experience. The following examples below explain some of the more advanced aspects of this template and provide you with a context to begin modifying deeper aspects of the jQuery Mobile framework.

Flexibility through CSS

One of the most advantageous aspects o the jQuery Mobile framework is its reliance on CSS for the layout and design. Since the core of the framework uses small amounts of HTML to build the structure, you only need to apply small amounts of CSS to alter the design.

In a multi-page implementation, you can use individual DIV tags for "pages," and use list views to create the homepage navigation to those pages. For more information on the page structure, refer to the article, Customizable starter design for jQuery Mobile. Since you make the listview from an unordered list, you can create CSS rules that target that list and redefine certain aspects to create larger buttons for the homepage.

The standard markup of a listview includes a data-role attribute assigned to the outer <UL> tag. See the code as follows:

<ul data-role="listview"> <li> <a href="#about_us">About Us</a> ... </li> </ul>

Using a technique called injection, the jQuery framework adds additional CSS and HTML into the <UL> element and turns the above code into the following code snippet.

<ul data-role="listview" class="ui-listview"> <li class="btn_a ui-btn ui-btn-up-a ui-btn-icon-right ui-li-has-arrow ui-li" data-theme="a"> <div class="ui-btn-inner ui-li" aria-hidden="true"> <div class="ui-btn-text"> <a href="#about_us" class="ui-link-inherit">About Us</a> ... </div> <span class="ui-icon ui-icon-arrow-r ui-icon-shadow"> </span> </div> </li> </ul>

In addition to adding <DIV> and <SPAN> elements injected within the <LI> elements, the process also injects a class named ui-listview into the <UL> element at runtime with JavaScript. This gives you a path to target with your CSS rules, a path to lock on to. Lastly, having the list view inside of a <DIV> with an id set to home , you can use the following CSS rule name to specifically target the list view of the homepage:

#home .ui-listview { }

The following figure shows the restyled list.

Figure 3. Restyled list.
Figure 3. Restyled list.

Using a Sprite Sheet and custom class assigned to each <LI> , you can adjust the x-position of the background graphic to create individual graphical buttons from a single image. In addition to a background image, you can also assign a padding-top to the nested <A> tags to give vertical room for the button graphics as shown in the following image.

Figure 4. Sprite Sheet
Figure 4. Sprite Sheet

The combination of these CSS rules and HTML markup transforms a traditional unordered list into an icon-based navigational system.

Combining ThemeRoller with custom CSS

The jQuery Mobile website includes an online tool theme creation tool called ThemeRoller. This is a web-based tool that allows you to design color schemes for use with your custom jQuery mobile websites. The jQuery Mobile framework is built on the notion of themes, which are predefined styles for the look of your mobile website. Each theme includes a series style groups called swatches, which you can apply to entire jQuery Mobile pages, or just to a portion of a page. While you can certainly override the many CSS rules contained within a swatch, it is more efficient to create entirely new themes using ThemeRoller.

Figure 5. Creating new themes with ThemeRoller
Figure 5. Creating new themes with ThemeRoller

The ThemeRoller online design tool allows you to create, modify, and save themes for use in your projects. Once you download and unzip your theme, copy the files into your project folder and link the CSS. The ThemeRoller site even offers some HTML within the download window.

Adding some custom jQuery scripts

If you consider the fact that jQuery Mobile is built on jQuery, I have to point out the fact that you can use some simple scripts to add even more functionality into our mobile website. The template included with this tutorial that you can download from the Requirements section at the beginning of this article includes a simple script and some custom HTML that allows you to dynamically change the content of the Contact Us page based on the link that invokes it. Using a single Contact Us page, you will learn how to change the page's information based on HTML you add to each link.

The listview links below contain an additional attribute in the <A> tag named data-phone . In this code snippet, put the phone number of that country's office. In conjunction with the linked text of the <a> tag, we have enough information to inject custom data into a single Contact Us page and give the user the experience of many custom contact pages.

<ul data-role="listview" data-filter="true" data-inset="true" class="countries"> <li><a class="location" href="#contact_us" data-phone="123-456-7891">Albania</a></li> <li><a class="location" href="#contact_us" data-phone="123-456-7892">Algeria</a></li> <li><a class="location" href="#contact_us" data-phone="123-456-7893">Argentina</a></li> … </ul>

By hooking in the custom JavaScript file, you can lock on to many aspects of the markup and jQuery, and further manipulate the user experience. In this template I included a simple set of jQuery instructions that inject data into the Contact Us page, as shown in the following figure.

Figure 6. Injecting data into the Contact Us page
Figure 6. Injecting data into the Contact Us page

When the user taps or clicks a link in the location listing, the application uses jQuery to pick up the activated link, read the custom attribute and link label, and revise the elements of the Contact Us page with those elements. This gives you the ability to create the illusion of customized Contact Us pages, when, in fact, it is the same page with data dynamically injected into the page before it is animated.

Where to go from here

In addition to the layout and page loading capabilities, jQuery Mobile provides a number of interactive form enhancements as well. Using basic HTML form markup, you can transform items like radio buttons and dropdown menus into mobile-friendly user experiences. What's more, the Dreamweaver Insert Panel contains many objects relating to jQuery Mobile, which you can add to your mobile website with a single click.

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Simple styling with CSS
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 2: Styling the web page
  • Creating a Spry XML data set
  • Taking a Fireworks comp to a CSS-based layout in Dreamweaver – Part 2: Markup preparation
  • Taking a Fireworks comp to a CSS-based layout in Dreamweaver – Part 3: Layout and CSS
  • Designing with CSS – Part 5: Building site navigation
  • Creating your first website – Part 3: Styling the header and navigation menu
  • Small web team uses CSS to develop big-time magazine site
  • Tableless layouts with Dreamweaver CS4
  • Creating a simple three-column design

Tutorials and samples

Tutorials

  • Working with updated responsive layout features in the Dreamweaver CS6 update
  • Creating your first website – Part 3
  • Creating your first website – Part 2
  • Creating your first website – Part 5

Samples

  • Responsive design with jQuery marquee
  • Customizable starter design for jQuery Mobile
  • Customizable starter design for HTML5 video
  • Customizable starter design for multiscreen development

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

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 © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement