My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
InitOptions  
jQTouch Initialization Options
Updated Mar 14, 2010 by davidcol...@gmail.com

Options

option: default

  • addGlossToIcon: true - Set to false to prevent automatic glossy button effect on icon.
  • backSelector: '.back, .cancel, .goback' - A CSS selector for back links/buttons. When clicked, the page history goes back one, automatically reversing whichever entrance animation was used.
  • cacheGetRequests: (New!) true — Automatically caches GET requests, so subsequent clicks reference the already loaded data.
  • cubeSelector: (New!) '.cube' — Link selector for a cube animation.
  • dissolveSelector: (New!) '.dissolve' — Link selector for a dissolve animation.
  • fadeSelector: (New!) '.fade' — Link selector for a fade animation.
  • fixedViewport: true - Removes the user's ability to scale the page. Ensures the site behaves more like an application.
  • flipSelector: '.flip' - Link selector for a 3d flip animation.
  • formSelector: 'form' - Sets which forms are automatically submitted via Ajax.
  • fullScreen: true - The website will become a fullscreen application when saved to a user's home screen. Set to false to disable.
  • fullScreenClass: 'fullscreen' - Adds a class to the <body> when running in full-screen mode, to allow for easy detection and styling. Set to false to disable.
  • icon: false - Sets the home screen icon for the application. To use, pass a string path for a 57x57px PNG. Ex: icon: 'images/appicon.png'
  • initializeTouch: 'a, .touch' - Selector for items which are automatically given expanded touch events. This makes ordinary links more responsive and provides trigger events like swipe
  • popSelector: (New!) '.pop' - Link selector for a pop animation.
  • preloadImages: false - Pass an array of image paths to load them before page loads. Ex: ['images/link_over.png', 'images/link_select.png']
  • slideSelector: 'body > * > ul li a' - Link selector for the default slide-left transition. By default applies to all links within an unordered list. Accepts any jQuery-capable selector 'li > a, a:not(.dontslide)', etc.
  • slideupSelector: '.slideup' - Link selector for a slide up animation.
  • startupScreen: (New! 3.0 only) null - Pass a string path to a 320px x 460px startup screen for full screen apps.
  • statusBar: 'default' - Styles the status bar when running as a fullscreen app. Other options are black, and black-translucent.
  • submitSelector: (New!) '.submit' - Selector which, when clicked, will submit its parent form (and close keyboard if open).
  • swapSelector: (New!) '.swap' — Link selector for 3d swap animation.
  • useAnimations: (New!) true — Set to false to disable all animations.
Comment by neoj...@gmail.com, Sep 15, 2009

Fantastic!

Comment by david.es...@gmail.com, Oct 6, 2009

Thank you very much! n_n

Comment by johnzabr...@gmail.com, Oct 13, 2009

Why are forms automatically submitted by AJAX?

It seems as though jQTouch hardwires its form actions and general link actions to the href attribute... and assumes the href attribute is client-side. To circumvent this assumption for AJAX, it appears you require all AJAX requests are tunneled within a FORM element?

Do I have this right?

Comment by project member davidcol...@gmail.com, Oct 14, 2009

Forms are just submitted via Ajax for convenience. To turn this off, just pass formSelector: false in your init options. You could also do by class (or any other CSS selector), ala formSelector: '.ajaxform'. You have total control on how much jQTouch does automatically-

Comment by RogerDSm...@gmail.com, Oct 16, 2009

Is there a way to set the textarea in the forms demo to 1 col so I can use autogrow? setting cols=1 makes no difference .

Comment by j.r.viv...@gmail.com, Oct 16, 2009

initializeTouch in beta1 is now touchSelector in beta2

Comment by jasonl...@gmail.com, Nov 8, 2009

Is there any way to force the ajax form submit to use json? I'm still digging and haven't found a way to do this - yet. Thx.

Comment by jasonl...@gmail.com, Nov 8, 2009

Ok, I dug a bit. Not sure if this is the best way, but it works for r109.

I added the following lines:

441: dataType: settings.dataType, 474: dataType: "json",

This forces all form submits to be json - for me this is good since my app is a prototype for eventual iphone sdk apis.

Now I just have to figure out how to handle the success and error callbacks..

Comment by matyh...@gmail.com, Nov 11, 2009

Hi All

Loving jqtouch! Im struggling with the AJAX side of things.... Wanting to submit basics via ajax, but not really within a form, or using a input (button). E.g. just taking on the <li> which has an ajax event - updating the page a little and sending the page to a return ID.

Is there any examples out there.

Also im writting up my experiences on learning jqtouch with tutorials, can we extand this wiki to include them to help newbies?

Matt

Comment by bkfake-g...@yahoo.com, Nov 13, 2009

how does one use the jQT.formSubmit() function? I'm wanting to pragmatically submit a form just as if the user pressed the submit button... (ie form results returned via ajax...) $('formid').submit() seems to bypass jQtouch's ajax method... jQT.formSubmit('formid') seems to submit the form, but results are not shown... I see there's a 2nd callback parameter...

Comment by bkfake-g...@yahoo.com, Nov 16, 2009

I found the issue with formSubmit(): http://code.google.com/p/jqtouch/issues/detail?id=166

Comment by pway...@gmail.com, Dec 2, 2009

What is the best way to re-init a DIV once I add information from an AJAX call. I can build out the <LI> items, give them the right classes, but the touch doesn't seem to work correctly. I thought it might be because it's not blessed by the initialization routines. How can I get the jQT object to init the new <LI> items I create?

(Thanks. This is a wonderful project.)

Comment by parcej...@gmail.com, Dec 10, 2009

How can I change an option after it has been initialized? I initialize useFastTouch: false. I want to later on when I am in a DIV to make it useFastTouch: true

Comment by john.nic...@gmail.com, Dec 17, 2009

Is it possible to just turn off animations on the ajax form submissions? I have a form that returns multiple video tags and Safari will crash when it animates back to the form if animations are on. But I'd still like the animations on my non video content.

Comment by afah...@gmail.com, Mar 5, 2010

Is it possible to detect if the app has been launched from the home screen as opposed to via safari?

Comment by Saturn...@gmail.com, Mar 15, 2010

how to add loading image in Ajax Post form ?

Comment by micha.st...@gmail.com, Mar 15, 2010

Doeas someone has an answer to this question "how to add loading image in Ajax Post form ?"?

Thank you!

Comment by jsa...@gmail.com, Mar 19, 2010

How can I stop an application from rotating when the phone is flipped? I do not see such option...

Comment by mcandrew...@gmail.com, Mar 23, 2010

Why does the viewport get scrolled to the top when any animation starts, can I turn this off?

Comment by mfr...@gmail.com, Apr 3, 2010

Hello, is there a way to make copy paste work on a specific class or smth like that ?

Comment by scottplu...@gmail.com, Apr 6, 2010

The statement about the default for the slideSelector is not correct - it will only apply with something like {{{ body > div > ul li a

Comment by mrgoose...@gmail.com, Apr 21, 2010

@afahmed: if($("body").hasClass("fullscreen")) alert('launched as app'); if(!$("body").hasClass("fullscreen")) alert('launched in safari');

Comment by pstanw...@gmail.com, Apr 25, 2010

Hi,

I have a HTC Desire and trying to get JQTouch to go fullscreen.

Has anyone had success using JQTouch eith Android 2.1 browser?

Thanks

Paul

Comment by marst...@gmail.com, Apr 26, 2010

I'm seeing a lot of questions, and not too many answers. Is jQTouch still an active project? Anyone know of an iPhone JS lib with better documentation/support? Anyone have experience with Sproutcore?

Comment by bruno.in.dk, May 15, 2010

"not too many answers"

join the Google Group ... everyday there is a bunch of questions and answers :)

Google Project does not have any "send email upon comment added" so it's rare that someone came here and answer, our group is available and very active.

http://groups.google.com/group/jqtouch

Comment by rzimmerm...@gmail.com, Jun 28, 2010

Hi, does anyone know how to turn off orientation event, i what my webapp to be portrait even when it is moved.

Comment by bill.sna...@gmail.com, Jul 22, 2010

Here's a question for you all. How can I tell when it's safe to setup a tap event? I typically do that sort of thing after the document ready fires in jQuery. Problem is, how can I guarantee my ready fires AFTER jqTouch is all initialized?

Comment by hugh.sm...@gmail.com, Nov 19, 2010

I have been using rev-148 for a while now, and just downloaded rev-150. Now all of my external links don't work. Upon tapping on my iPhone (or clicking in Chrome on my PC) they don't go anywhere. Any suggestions on how to fix this?

Thanks to anyone who can give me some help.

- Hugh


Sign in to add a comment
Powered by Google Project Hosting