You are previewing Building iPhone Apps with HTML, CSS, and JavaScript.

Building iPhone Apps with HTML, CSS, and JavaScript

Cover of Building iPhone Apps with HTML, CSS, and JavaScript by Jonathan Stark Published by O'Reilly Media, Inc.
  1. Building iPhone Apps with HTML, CSS, and JavaScript
  2. Dedication
  3. A Note Regarding Supplemental Files
  4. Preface
    1. Who Should Read This Book
    2. What You Need to Use This Book
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
    7. Acknowledgments
  5. 1. Getting Started
    1. Web Apps Versus Native Apps
      1. What Is a Web App?
      2. What Is a Native App?
      3. Pros and Cons
      4. Which Approach Is Right for You?
    2. Web Programming Crash Course
      1. Intro to HTML
      2. Intro to CSS
      3. Intro to JavaScript
  6. 2. Basic iPhone Styling
    1. First Steps
      1. Preparing a Separate iPhone Stylesheet
      2. Controlling the Page Scaling
    2. Adding the iPhone CSS
    3. Adding the iPhone Look and Feel
    4. Adding Basic Behavior with jQuery
    5. What You’ve Learned
  7. 3. Advanced iPhone Styling
    1. Adding a Touch of Ajax
    2. Traffic Cop
    3. Simple Bells and Whistles
    4. Roll Your Own Back Button
    5. Adding an Icon to the Home Screen
    6. Full Screen Mode
      1. Changing the Status Bar
      2. Providing a Custom Startup Graphic
    7. What You’ve Learned
  8. 4. Animation
    1. With a Little Help from Our Friend
    2. Sliding Home
    3. Adding the Dates Panel
    4. Adding the Date Panel
    5. Adding the New Entry Panel
    6. Adding the Settings Panel
    7. Putting It All Together
    8. Customizing jQTouch
    9. What You’ve Learned
  9. 5. Client-Side Data Storage
    1. localStorage and sessionStorage
      1. Saving User Settings to localStorage
      2. Saving the Selected Date to sessionStorage
    2. Client-Side Database
      1. Creating a Database
      2. Inserting Rows
      3. Selecting Rows and Handling Result Sets
      4. Deleting Rows
    3. What You’ve Learned
  10. 6. Going Offline
    1. The Basics of the Offline Application Cache
    2. Online Whitelist and Fallback Options
    3. Creating a Dynamic Manifest File
    4. Debugging
      1. The JavaScript Console
      2. The Application Cache Database
    5. What You’ve Learned
  11. 7. Going Native
    1. Intro to PhoneGap
      1. Using the Screen’s Full Height
      2. Customizing the Title and Icon
      3. Creating a Startup Screen
    2. Installing Your App on the iPhone
    3. Controlling the iPhone with JavaScript
      1. Beep, Vibrate, and Alert
      2. Geolocation
      3. Accelerometer
    4. What You’ve Learned
  12. 8. Submitting Your App to iTunes
    1. Creating an iPhone Distribution Provisioning Profile
    2. Installing the iPhone Distribution Provisioning Profile
    3. Renaming the Project
    4. Prepare the Application Binary
    5. Submit Your App
    6. While You Wait
    7. Further Reading
  13. Index
  14. About the Author
  15. Colophon
  16. Copyright
O'Reilly logo

Chapter 2. Basic iPhone Styling

Ultimately, we are going to build a native iPhone app using HTML, CSS, and JavaScript. The first step on this journey is to get comfortable styling HTML to look like an iPhone app. In this chapter, I’ll show you how to apply CSS styles to a bunch of existing HTML pages so that they are easily navigable on an iPhone. So, in addition to moving closer to building a native app, you’ll be learning a practical (and valuable) skill that you can use immediately.

The best content for your career. Discover unlimited learning on demand for around $1/day.