Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 4. Animation > Customizing jQTouch

4.8. Customizing jQTouch

jQTouch allows you to customize its default behavior by sending a variety of property settings into the constructor. We’ve seen this previously with icon and statusBar, but there are many others that you should be aware of. See Table 4-1.

Table 4-1. jQTouch customization options
PropertyDefaultExpectsNotes
addGlossToIcontruetrue or falseIf set to true, allow iPhone to add gloss to your Web Clip icon.
backSelector'.back, .cancel, .goback'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger the “back” behavior of jQTouch when tapped. When the back behavior is invoked, the current panel moves off screen with a reverse animation and is removed from history.
cacheGetRequeststruetrue or falseIf set to true, automatically caches GET requests, so subsequent clicks reference the already loaded data.
cubeSelector'.cube'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger a cube animation from the current panel to the target panel.
dissolveSelector'.dissolve'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger a dissolve animation from the current panel to the target panel.
fadeSelector'.fade'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger a fade animation from the current panel to the target panel.
fixedViewporttruetrue or falseIf set to true, prevents users from being able to zoom in or out on the page.
flipSelector'.flip'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger a flip animation from the current panel to the target panel.
formSelector'form'Any valid CSS selector; separate multiple values with a commaDefines elements that should be styled as a form by the CSS theme.
fullScreentruetrue or falseWhen set to true, your app will open in full screen mode when launched from the user’s home screen. Has no effect on the display if the app is running in Mobile Safari.
fullScreenClass'fullscreen'StringClass name that will be applied to the body when the app is launched in full screen mode. Allows you to write custom CSS that only executes in full screen mode.
iconnullnull or a relative or absolute path to a 57 × 57 px png image fileThe Web Clip icon for your app. This is the image that will be displayed when a user saves your app to her home screen.
popSelector'.pop'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger a pop animation from the current panel to the target panel.
preloadImagesfalseAn array of image paths to load before page loadsEx: ['images/link_over.png', 'images/link_select.png'].
slideSelector'ul li a'Any valid CSS selector; separate multiple values with a commaDefines elements that will trigger a slide left animation from the current panel to the target panel.
slideupSelector'.slideup'Any valid CSS selector; separate multiple values with a commaDefines elements that will cause the target panel to slide up into view in front of the current panel.
startupScreennullnull or a relative or absolute path to an image filePass a relative or absolute path to a 320px × 460px startup screen for full-screen apps. Use a 320px × 480px image if you set statusBar to black-translucent.
statusBar'default'default, black-translucent, blackDefines the appearance of the 20-pixel status bar at the top of the window in an app launched in full screen mode.
submitSelector'.submit'Any valid CSS selector; separate multiple values with a commaSelector that, when clicked, will submit its parent form (and close keyboard if open).
swapSelector'.swap'Any valid CSS selector; separate multiple values with a commaDefines elements that will cause the target panel to swap into view in front of the current panel.
useAnimationstruetrue or falseSet to false to disable all animations.