From 499bcb6458fa7dda44dcbbceed5465e2842f9df4 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Thu, 11 Nov 2010 16:12:14 -0500 Subject: [PATCH] added methods documentation --- docs/api/index.html | 1 + docs/api/methods.html | 143 ++++++++++++++++++++++++++++++++++++++++++ index.html | 1 + 3 files changed, 145 insertions(+) create mode 100755 docs/api/methods.html diff --git a/docs/api/index.html b/docs/api/index.html index 8efcbb02..6be54654 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -20,6 +20,7 @@
  • API
  • Configuring defaults
  • Events: touch, page, animation
  • +
  • Methods: Change pages, Loading messages, etc
  • Orientation & resolution targeting
  • Theme framework
  • diff --git a/docs/api/methods.html b/docs/api/methods.html new file mode 100755 index 00000000..61a4e0ef --- /dev/null +++ b/docs/api/methods.html @@ -0,0 +1,143 @@ + + + + + jQuery Mobile Docs - Methods + + + + + + +
    + +
    +

    Methods

    +
    + +
    + + +

    jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.

    + + +
    +
    $.mobile.changePage (method)
    +
    Programmatically change from one page to another. This method is used internally for transitions that occur as a result of clicking a link or submitting a form, when those features are enabled.
    + +
    + +
    +
    Arguments
    +
    to +
      +
    • String, url to transition to ("about/us.html")
    • +
    • jQuery object ($("#about"))
    • +
    • Array specifying two page references [from,to] for transitioning from a known page. From is otherwise assumed to be the current page in view (or $.mobile.activePage ).
    • +
    • Object for sending form data. ({to: url, data: serialized form data, type: "get" or "post"}
    • +
    + +
    transition (string, examples: "pop", "slide"," "none")
    +
    back (boolean, default: false). True will cause a reverse-direction transition.
    +
    changeHash (boolean, default: true). Update the hash to the to page's URL when page change is complete.
    +
    +
    + +
    Examples: +
    +			
    +//transition to the "about us" page with a slideup transition, where 			
    +$.mobile.changePage("about/us.html", "slideup");	
    +
    +//transition to the "search results" page, using data from a form with an ID of "search"" 		
    +$.mobile.changePage({
    +	url: "searchresults.php", 
    +	type: "get", 
    +	data: $("form#search").serialize()
    +});		
    +
    +//transition to the "confirm" page with a "pop" transition without tracking it in history			
    +$.mobile.changePage("../alerts/confirm.html", "pop", false, false);	
    +		
    +			
    +			
    + +
    + +
    $.mobile.pageLoading (method)
    +
    Show or hide the page loading message, which is configurable via $.mobile.loadingMessage.
    +
    +
    +
    Arguments:
    +
    Done (boolean, defaults to false, meaning loading has started). True will hide the loading message.
    +
    +
    + +
    Examples: +
    +			
    +//cue the page loader 			
    +$.mobile.pageLoading();	
    +
    +//hide the page loader 			
    +$.mobile.pageLoading( true );	
    +			
    +			
    + +
    + + +
    $.mobile.silentScroll (method)
    +
    Scroll to a particular Y position without triggering scroll event listeners.
    +
    +
    +
    Arguments:
    +
    yPos (number, defaults to 0). Pass any number to scroll to that Y location.
    +
    +
    + +
    Examples: +
    +			
    +//scroll to Y 100px 			
    +$.mobile.silentScroll(100);	
    +			
    +			
    + +
    + + +
    $.mobile.addResolutionBreakpoints (method)
    +
    Add width breakpoints to the min/max width classes that are added to the HTML element.
    +
    +
    +
    Arguments:
    +
    values (number or array). Pass any number or array of numbers to add to the resolution classes. Read more about this feature here: Orientation & resolution targeting.
    +
    +
    + +
    Examples: +
    +			
    +//scroll to Y 100px 			
    +$.mobile.silentScroll(100);	
    +			
    +			
    + +
    + + + +
    $.mobile.activePage (property)
    +
    Reference to the page currently in view.
    + + + + +
    +
    + +
    + + + \ No newline at end of file diff --git a/index.html b/index.html index 939a099d..097de053 100755 --- a/index.html +++ b/index.html @@ -31,6 +31,7 @@
  • API
  • Configuring defaults
  • Events: touch, page, animation
  • +
  • Methods: Change pages, Loading messages, etc
  • Orientation & resolution targeting
  • Theme framework