jquery Mobile Tutorial: The properties of jquery Mobile

Source: Internet
Author: User
Tags define

Article Introduction: Let's take a look at some of the properties of jquery Mobile.

In this article, let's take a look at some of the properties of jquery Mobile
(Note: The code snippet in the following example is from version 1.1.0)
First, explain the concept of each view or page in jquery Mobile:
How do you define a page container?
From the previous tutorial, you should have read the following code:

A separate page <div data-role= "page" ></div>  //Multiple page <div data-role= "page" id= "Home-page" > </ div>  <div data-role= "page" id= "Copyright-page" > </div>

In fact, page configuration is very simple, but we look at the following source:

#7470 var $pages = $ (": Jqmdata (role= ' page '),: Jqmdata (role= ' dialog ')");		 if (! $pages. Length) { 	$pages = $ ("Body"). Wrapinner ("<div data-" + $.mobile.ns + role= ' page ' ></div> "). Children (0); }

Description
1, in fact, data-role= "dialog" for the jquery Mobile system is also a page everyone looked at the previous example of the dialog, found that it is not what we generally think of a traditional floating layer
2, how the page does not define page and dialog, the system will default to add a of course, this situation is very rare

Said so much, we look at the end which 3 attributes or more important!

1, $.mobile.pagecontainer

The return is: Store the page container, in the system is actually the body

SOURCE section:

#7488行 $.mobile.pagecontainer = $pages. A (). Parent (). addclass ("Ui-mobile-viewport");   	
2, $.mobile.firstpage

Returns: the first page

SOURCE section:

#7488行 	  
3, $.mobile.activepage

Returns the page or dialog that is currently visible

SOURCE section:

#3385行 $.mobile.activepage = topage;  


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.