methods.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>jQuery Mobile Docs - Methods</title>
  7. <link rel="stylesheet" href="../../jquery.mobile-1.0.1.min.css" />
  8. <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
  9. <script src="../../jquery.js"></script>
  10. <script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
  11. <script src="../_assets/js/jqm-docs.js"></script>
  12. <script src="../../jquery.mobile-1.0.1.min.js"></script>
  13. </head>
  14. <body>
  15. <div data-role="page" class="type-interior">
  16. <div data-role="header" data-theme="f">
  17. <h1>Methods</h1>
  18. <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
  19. </div><!-- /header -->
  20. <div data-role="content">
  21. <div class="content-primary">
  22. <p>jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.</p>
  23. <dl>
  24. <dt><code>$.mobile.changePage</code> (<em>method</em>)</dt>
  25. <dd>Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled.</dd>
  26. <dd>
  27. <dl>
  28. <dt><code>&#183;</code> Arguments</dt>
  29. <dd><code>to</code> (<em>string or object</em>, required)
  30. <ul>
  31. <li>String: Absolute or relative URL. (&quot;about/us.html&quot;)</li>
  32. <li>Object: jQuery collection object. (<code>$("#about")</code>)</li>
  33. </ul>
  34. </dd>
  35. <dd><code>options</code> (<em>object</em>, optional)
  36. <ul>
  37. <li>Properties:
  38. <ul>
  39. <li><code>allowSamePageTransition</code> (<em>boolean</em>, default: false) By default, changePage() ignores requests to change to the current active page. Setting this option to true, allows the request to execute. Developers should note that some of the page transitions assume that the fromPage and toPage of a changePage request are different, so they may not animate as expected. Developers are responsible for either providing a proper transition, or turning it off for this specific case.</li>
  40. <li><code>changeHash</code> (<em>boolean</em>, default: true) Decides if the hash in the location bar should be updated. </li>
  41. <li><code>data</code> (<em>object</em> or string, default: undefined) The data to send with an Ajax page request.
  42. <ul>
  43. <li>Used only when the 'to' argument of changePage() is a URL.</li>
  44. </ul>
  45. </li>
  46. <li><code>dataUrl</code> (string, default: undefined) The URL to use when updating the browser location upon changePage completion.
  47. If not specified, the value of the data-url attribute of the page element is used.</li>
  48. <li><code>pageContainer</code> (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page. </li>
  49. <li><code>reloadPage</code> (<em>boolean</em>, default: false) Forces a reload of a page, even if it is already in the DOM of the page container.
  50. <ul>
  51. <li>Used only when the 'to' argument of changePage() is a URL.</li>
  52. </ul>
  53. </li>
  54. <li><code>reverse</code> (<em>boolean</em>, default: false) Decides what direction the transition will run when showing the page. </li>
  55. <li><code>showLoadMsg</code> (<em>boolean</em>, default: true) Decides whether or not to show the loading message when loading external pages.</li>
  56. <li><code>role</code> (<em>string</em>, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.</li>
  57. <li><code>transition</code> (<em>string</em>, default: $.mobile.defaultPageTransition) The transition to use when showing the page. </li>
  58. <li><code>type</code> (<em>string</em>, default: &quot;get&quot;) Specifies the method ("get" or "post") to use when making a page request.
  59. <ul>
  60. <li>Used only when the 'to' argument of changePage() is a URL.</li>
  61. </ul>
  62. </li>
  63. </ul>
  64. </li>
  65. </ul>
  66. </dd>
  67. </dl>
  68. </dd>
  69. <dd>Examples:
  70. <pre>
  71. <code>
  72. <strong>//transition to the "about us" page with a slideup transition</strong>
  73. $.mobile.changePage( "about/us.html", { transition: "slideup"} );
  74. <strong>//transition to the "search results" page, using data from a form with an ID of "search"" </strong>
  75. $.mobile.changePage( "searchresults.php", {
  76. type: "post",
  77. data: $("form#search").serialize()
  78. });
  79. <strong>//transition to the "confirm" page with a "pop" transition without tracking it in history </strong>
  80. $.mobile.changePage( "../alerts/confirm.html", {
  81. transition: "pop",
  82. reverse: false,
  83. changeHash: false
  84. });
  85. </code>
  86. </pre>
  87. </dd>
  88. <dt><code>$.mobile.loadPage</code> (<em>method</em>)</dt>
  89. <dd>Load an external page, enhance its content, and insert it into the DOM. This method is called internally by the changePage() function when its first argument is a URL. This function does not affect the current active page so it can be used to load pages in the background. The function returns a deferred promise object that gets resolved after the page has been enhanced and inserted into the document.</dd>
  90. <dd>
  91. <dl>
  92. <dt><code>&#183;</code> Arguments</dt>
  93. <dd><code>url</code> (<em>string or object</em>, required) A relative or absolute URL.</dd>
  94. <dd><code>options</code> (<em>object</em>, optional)
  95. <ul>
  96. <li>Properties:
  97. <ul>
  98. <li><code>data</code> (<em>object</em> or string, default: undefined) The data to send with an Ajax page request. </li>
  99. <li><code>loadMsgDelay</code> (<em>number (in ms)</em>, default: 50) Forced delay before the loading message is shown. This is meant to allow time for a page that has already been visited to be fetched from cache without a loading message.</li>
  100. <li><code>pageContainer</code> (jQuery collection, default: $.mobile.pageContainer) Specifies the element that should contain the page after it is loaded. </li>
  101. <li><code>reloadPage</code> (<em>boolean</em>, default: false) Forces a reload of a page, even if it is already in the DOM of the page container. </li>
  102. <li><code>role</code> (<em>string</em>, default: undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.</li>
  103. <li><code>type</code> (<em>string</em>, default: &quot;get&quot;) Specifies the method ("get" or "post") to use when making a page request.
  104. </li>
  105. </ul>
  106. </li>
  107. </ul>
  108. </dd>
  109. </dl>
  110. </dd>
  111. <dd>Examples:
  112. <pre>
  113. <code>
  114. <strong>//load the "about us" page into the DOM</strong>
  115. $.mobile.loadPage( "about/us.html" );
  116. <strong>//load a "search results" page, using data from a form with an ID of "search"" </strong>
  117. $.mobile.loadPage( "searchresults.php", {
  118. type: "post",
  119. data: $("form#search").serialize()
  120. });
  121. </code>
  122. </pre>
  123. </dd>
  124. <dt><code>jqmData(), jqmRemoveData()</code> (<em>method</em>)</dt>
  125. <dd>When working with jQuery Mobile, <code>jqmData</code> and <code>jqmRemoveData</code> should be used in place of jQuery core's <code>data</code> and <code>removeData</code> methods (note that this includes $.fn.data, $.fn.removeData, and the $.data, $.removeData, and $.hasData utilities), as they automatically incorporate getting and setting of namespaced data attributes (even if no namespace is currently in use).</dd>
  126. <dd>
  127. <dl>
  128. <dt><code>&#183;</code> Arguments:</dt>
  129. <dd>See jQuery's <a href="http://api.jquery.com/jQuery.data/">data</a> and <a href="http://api.jquery.com/jQuery.removeData/">removeData</a> methods</dd>
  130. <strong>Note: </strong>Calling jqmData() with no argument will return <code>undefined</code>. This behavior is subject to change in future versions.
  131. <dt><code>&#183;</code> Also:</dt>
  132. <dd>When finding elements by their jQuery Mobile data attribute, please use the custom selector <code>:jqmData()</code>, as it automatically incorporates namespaced data attributes into the lookup when they are in use. For example, instead of calling <code>$("div[data-role='page']")</code>, you should use <code>$("div:jqmData(role='page')")</code>, which internally maps to <code>$("div[data-"+ $.mobile.ns +"role='page']")</code> without forcing you to concatenate a namespace into your selectors manually.</dd>
  133. </dl>
  134. </dd>
  135. <dt><code>$.mobile.showPageLoadingMsg</code> (<em></em>)</dt>
  136. <dd>Show the page loading message, which is configurable via $.mobile.loadingMessage.</dd>
  137. <dd>Example:
  138. <pre>
  139. <code>
  140. <strong>//cue the page loader</strong>
  141. $.mobile.showPageLoadingMsg();
  142. </code>
  143. </pre>
  144. </dd>
  145. <dt><code>$.mobile.hidePageLoadingMsg</code> (<em></em>)</dt>
  146. <dd>Hide the page loading message, which is configurable via $.mobile.loadingMessage.</dd>
  147. <dd>Example:
  148. <pre>
  149. <code>
  150. <strong>//cue the page loader</strong>
  151. $.mobile.hidePageLoadingMsg();
  152. </code>
  153. </pre>
  154. </dd>
  155. <dt><code>$.mobile.fixedToolbars.show</code> (<em>method</em>)</dt>
  156. <dd>Utility method for displaying the fixed header and/or footer of the current active page within the viewport. Note that fixed headers/footers are never really hidden. Toggling the show/hide state of a toolbar is really toggling whether or not they are inline within the page content, or displayed within the viewport as if they were fixed.</dd>
  157. <dd>
  158. <dl>
  159. <dt><code>&#183;</code> Arguments</dt>
  160. <dd><code>immediately</code> (<em>boolean</em>, optional) If true, any fixed header or footer for the current active page is displayed immediately within the viewport. If false or unspecified, the fixed header/footer will fade-in after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in an additional delay before the start of the header/footer display animation.</dd>
  161. </dl>
  162. </dd>
  163. <dd>Example:
  164. <pre>
  165. <code>
  166. <strong>// Show fixed header/footer with a fade animation.</strong>
  167. $.mobile.fixedToolbars.show();
  168. <strong>// Show fixed header/footer immediately.</strong>
  169. $.mobile.fixedToolbars.show(true);
  170. </code>
  171. </pre>
  172. </dd>
  173. <dt><code>$.mobile.fixedToolbars.hide</code> (<em>method</em>)</dt>
  174. <dd>Utility method for hiding the fixed header and/or footer of the current active page.</dd>
  175. <dd>
  176. <dl>
  177. <dt><code>&#183;</code> Arguments</dt>
  178. <dd><code>immediately</code> (<em>boolean</em>, optional) If true, any fixed header or footer for the current active page is immediately placed inline (back in flow) with the page content, which means it will scroll along with the content and will only be visible when viewing the top or bottom of the page within the viewport. If false or unspecified, the fixed header/footer will fade-out after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in the header/footer being immediately hidden.</dd>
  179. </dl>
  180. </dd>
  181. <dd>Example:
  182. <pre>
  183. <code>
  184. <strong>// Hide fixed header/footer with a fade animation.</strong>
  185. $.mobile.fixedToolbars.hide();
  186. <strong>// Hide fixed header/footer immediately.</strong>
  187. $.mobile.fixedToolbars.hide(true);
  188. </code>
  189. </pre>
  190. </dd>
  191. <dt><code>$.mobile.path.parseUrl</code> (<em>method</em>)</dt>
  192. <dd>Utility method for parsing a URL and its relative variants into an object that makes accessing the components of the URL easy. When parsing relative variants, the resulting object will contain empty string values for missing components (like protocol, host, etc). Also, when parsing URLs that have no authority, such as tel: urls, the pathname property of the object will contain the data after the protocol/scheme colon.</dd>
  193. <dd>
  194. <dl>
  195. <dt><code>&#183;</code> Arguments</dt>
  196. <dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>
  197. <dt><code>&#183;</code> Return Value</dt>
  198. <dd>
  199. <p>This function returns an object that contains the various components of the URL as strings. The properties on the object mimic the browser's location object:</p>
  200. <dl>
  201. <dt><code>hash</code></dt>
  202. <dd>The fragment conponent of the URL, including the leading '#' character.</dd>
  203. <dt><code>host</code></dt>
  204. <dd>The host and port number of the URL.</dd>
  205. <dt><code>hostname</code></dt>
  206. <dd>The name of the host within the URL.</dd>
  207. <dt><code>href</code></dt>
  208. <dd>The original URL that was parsed.</dd>
  209. <dt><code>pathname</code></dt>
  210. <dd>The path of the file or directory referenced by the URL.</dd>
  211. <dt><code>port</code></dt>
  212. <dd>The port specified within the URL. Most URLs rely on the default port for the protocol used, so this may be an empty string most of the time.</dd>
  213. <dt><code>protocol</code></dt>
  214. <dd>The protocol for the URL including the trailing ':' character.</dd>
  215. <dt><code>search</code></dt>
  216. <dd>The query component of the URL including the leading '?' character.</dd>
  217. </dl>
  218. <p>But it also contains additional properties that provide access to additional components as well as some common forms of the URL developers access:</p>
  219. <dl>
  220. <dt><code>authority</code></dt>
  221. <dd>The username, password, and host components of the URL</dd>
  222. <dt><code>directory</code></dt>
  223. <dd>The directory component of the pathname, minus any filename.</dd>
  224. <dt><code>domain</code></dt>
  225. <dd>The protocol and authority components of the URL.</dd>
  226. <dt><code>filename</code></dt>
  227. <dd>The filename within the pathname component, minus the directory.</dd>
  228. <dt><code>hrefNoHash</code></dt>
  229. <dd>The original URL minus the fragment (hash) components.</dd>
  230. <dt><code>hrefNoSearch</code></dt>
  231. <dd>The original URL minus the query (search) and fragment (hash) components.</dd>
  232. <dt><code>password</code></dt>
  233. <dd>The password contained within the authority component.</dd>
  234. <dt><code>username</code></dt>
  235. <dd>The username contained within the authority component.</dd>
  236. </dl>
  237. </dd>
  238. </dl>
  239. </dd>
  240. <dd>Examples:
  241. <pre>
  242. <code>
  243. <strong>// Parsing the Url below results an object that is returned with the
  244. // following properties:
  245. //
  246. // obj.href: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&amp;type=unread#msg-content
  247. // obj.hrefNoHash: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&amp;type=unread
  248. // obj.hrefNoSearch: http://jblas:password@mycompany.com:8080/mail/inbox
  249. // obj.domain: http://jblas:password@mycompany.com:8080
  250. // obj.protocol: http:
  251. // obj.authority: jblas:password@mycompany.com:8080
  252. // obj.username: jblas
  253. // obj.password: password
  254. // obj.host: mycompany.com:8080
  255. // obj.hostname: mycompany.com
  256. // obj.port: 8080
  257. // obj.pathname: /mail/inbox
  258. // obj.directory: /mail/
  259. // obj.filename: inbox
  260. // obj.search: ?msg=1234&amp;type=unread
  261. // obj.hash: #msg-content</strong>
  262. var obj = $.mobile.path.parseUrl("http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234");
  263. </code>
  264. </pre>
  265. </dd>
  266. <dt><code>$.mobile.path.makePathAbsolute</code> (<em>method</em>)</dt>
  267. <dd>Utility method for converting a relative file or directory path into an absolute path.</dd>
  268. <dd>
  269. <dl>
  270. <dt><code>&#183;</code> Arguments</dt>
  271. <dd><code>relPath</code> (<em>string</em>, required) A relative file or directory path.</dd>
  272. <dd><code>absPath</code> (<em>string</em>, required) An absolute file or relative path to resolve against.</dd>
  273. <dt><code>&#183;</code> Return Value</dt>
  274. <dd>This function returns a string that is an absolute version of the relative path passed in.</dd>
  275. </dl>
  276. </dd>
  277. <dd>Examples:
  278. <pre>
  279. <code>
  280. <strong>// Returns: /a/b/c/file.html</strong>
  281. var absPath = $.mobile.path.makePathAbsolute("file.html", "/a/b/c/bar.html");
  282. <strong>// Returns: /a/foo/file.html</strong>
  283. var absPath = $.mobile.path.makePathAbsolute("../../foo/file.html", "/a/b/c/bar.html");
  284. </code>
  285. </pre>
  286. </dd>
  287. <dt><code>$.mobile.path.makeUrlAbsolute</code> (<em>method</em>)</dt>
  288. <dd>Utility method for converting a relative URL to an absolute URL.</dd>
  289. <dd>
  290. <dl>
  291. <dt>Arguments</dt>
  292. <dd><code>relUrl</code> (<em>string</em>, required) A relative URL.</dd>
  293. <dd><code>absUrl</code> (<em>string</em>, required) An absolute URL to resolve against.</dd>
  294. <dt>Return Value</dt>
  295. <dd>This function returns a string that is an absolute version of the relative URL passed in.</dd>
  296. </dl>
  297. </dd>
  298. <dd>Examples:
  299. <pre>
  300. <code>
  301. <strong>// Returns: http://foo.com/a/b/c/file.html</strong>
  302. var absUrl = $.mobile.path.makeUrlAbsolute("file.html", "http://foo.com/a/b/c/test.html");
  303. <strong>// Returns: http://foo.com/a/foo/file.html</strong>
  304. var absUrl = $.mobile.path.makeUrlAbsolute("../../foo/file.html", "http://foo.com/a/b/c/test.html");
  305. <strong>// Returns: http://foo.com/bar/file.html</strong>
  306. var absUrl = $.mobile.path.makeUrlAbsolute("//foo.com/bar/file.html", "http://foo.com/a/b/c/test.html");
  307. <strong>// Returns: http://foo.com/a/b/c/test.html?a=1&amp;b=2</strong>
  308. var absUrl = $.mobile.path.makeUrlAbsolute("?a=1&amp;b=2", "http://foo.com/a/b/c/test.html");
  309. <strong>// Returns: http://foo.com/a/b/c/test.html#bar</strong>
  310. var absUrl = $.mobile.path.makeUrlAbsolute("#bar", "http://foo.com/a/b/c/test.html");
  311. </code>
  312. </pre>
  313. </dd>
  314. <dt><code>$.mobile.path.isSameDomain</code> (<em>method</em>)</dt>
  315. <dd>Utility method for comparing the domain of 2 URLs.</dd>
  316. <dd>
  317. <dl>
  318. <dt><code>&#183;</code> Arguments</dt>
  319. <dd><code>url1</code> (<em>string</em>, required) A relative URL.</dd>
  320. <dd><code>url2</code> (<em>string</em>, required) An absolute URL to resolve against.</dd>
  321. <dt>Return Value</dt>
  322. <dd>This function returns a boolean true if the domains match, false if they don't.</dd>
  323. </dl>
  324. </dd>
  325. <dd>Examples:
  326. <pre>
  327. <code>
  328. <strong>// Returns: true</strong>
  329. var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
  330. <strong>// Returns: false</strong>
  331. var same = $.mobile.path.isSameDomain("file://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
  332. <strong>// Returns: false</strong>
  333. var same = $.mobile.path.isSameDomain("https://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
  334. <strong>// Returns: false</strong>
  335. var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://bar.com/a/b/c/test.html");
  336. </code>
  337. </pre>
  338. </dd>
  339. <dt><code>$.mobile.path.isRelativeUrl</code> (<em>method</em>)</dt>
  340. <dd>Utility method for determining if a URL is a relative variant.</dd>
  341. <dd>
  342. <dl>
  343. <dt><code>&#183;</code> Arguments</dt>
  344. <dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>
  345. <dt><code>&#183;</code> Return Value</dt>
  346. <dd>This function returns a boolean true if the URL is relative, false if it is absolute.</dd>
  347. </dl>
  348. </dd>
  349. <dd>Examples:
  350. <pre>
  351. <code>
  352. <strong>// Returns: false</strong>
  353. var isRel = $.mobile.path.isRelativeUrl("http://foo.com/a/file.html");
  354. <strong>// Returns: true</strong>
  355. var isRel = $.mobile.path.isRelativeUrl("//foo.com/a/file.html");
  356. <strong>// Returns: true</strong>
  357. var isRel = $.mobile.path.isRelativeUrl("/a/file.html");
  358. <strong>// Returns: true</strong>
  359. var isRel = $.mobile.path.isRelativeUrl("file.html");
  360. <strong>// Returns: true</strong>
  361. var isRel = $.mobile.path.isRelativeUrl("?a=1&amp;b=2");
  362. <strong>// Returns: true</strong>
  363. var isRel = $.mobile.path.isRelativeUrl("#foo");
  364. </code>
  365. </pre>
  366. </dd>
  367. <dt><code>$.mobile.path.isAbsoluteUrl</code> (<em>method</em>)</dt>
  368. <dd>Utility method for determining if a URL is absolute.</dd>
  369. <dd>
  370. <dl>
  371. <dt><code>&#183;</code> Arguments</dt>
  372. <dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>
  373. <dt><code>&#183;</code> Return Value</dt>
  374. <dd>This function returns a boolean true if the URL is absolute, false if not.</dd>
  375. </dl>
  376. </dd>
  377. <dd>Examples:
  378. <pre>
  379. <code>
  380. <strong>// Returns: true</strong>
  381. var isAbs = $.mobile.path.isAbsoluteUrl("http://foo.com/a/file.html");
  382. <strong>// Returns: false</strong>
  383. var isAbs = $.mobile.path.isAbsoluteUrl("//foo.com/a/file.html");
  384. <strong>// Returns: false</strong>
  385. var isAbs = $.mobile.path.isAbsoluteUrl("/a/file.html");
  386. <strong>// Returns: false</strong>
  387. var isAbs = $.mobile.path.isAbsoluteUrl("file.html");
  388. <strong>// Returns: false</strong>
  389. var isAbs = $.mobile.path.isAbsoluteUrl("?a=1&amp;b=2");
  390. <strong>// Returns: false</strong>
  391. var isAbs = $.mobile.path.isAbsoluteUrl("#foo");
  392. </code>
  393. </pre>
  394. </dd>
  395. <dt><code>$.mobile.base</code> (<em>methods, properties</em>)</dt>
  396. <dd>Utilities for working with generated base element. TODO: document as public API is finalized.</dd>
  397. <dt><code>$.mobile.silentScroll</code> (<em>method</em>)</dt>
  398. <dd>Scroll to a particular Y position without triggering scroll event listeners.</dd>
  399. <dd>
  400. <dl>
  401. <dt><code>&#183;</code> Arguments:</dt>
  402. <dd><code>yPos</code> (<em>number</em>, defaults to 0). Pass any number to scroll to that Y location.</dd>
  403. </dl>
  404. </dd>
  405. <dd>Examples:
  406. <pre>
  407. <code>
  408. <strong>//scroll to Y 100px</strong>
  409. $.mobile.silentScroll(100);
  410. </code>
  411. </pre>
  412. </dd>
  413. <dt><code>$.mobile.activePage</code> (<em>property</em>)</dt>
  414. <dd>Reference to the page currently in view.</dd>
  415. </dl>
  416. </div><!--/content-secondary -->
  417. <div class="content-secondary">
  418. <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
  419. <h3>More in this section</h3>
  420. <ul data-role="listview" data-theme="c" data-dividertheme="d">
  421. <li data-role="list-divider">API</li>
  422. <li><a href="../../docs/api/globalconfig.html">Configuring defaults</a></li>
  423. <li><a href="../../docs/api/events.html">Events</a></li>
  424. <li data-theme="a"><a href="../../docs/api/methods.html">Methods &amp; Utilities</a></li>
  425. <li><a href="../../docs/api/data-attributes.html">Data attribute reference</a></li>
  426. <li><a href="../../docs/api/themes.html">Theme framework</a></li>
  427. </ul>
  428. </div>
  429. </div>
  430. </div><!-- /content -->
  431. <div data-role="footer" class="footer-docs" data-theme="c">
  432. <p>&copy; 2011-2012 The jQuery Project</p>
  433. </div>
  434. </div><!-- /page -->
  435. </body>
  436. </html>