jquery Mobile's external pannel

Source: Internet
Author: User

This period of time to develop a mobile version of the Web site, because there is no mobile Web development related experience, online check, found that the jquery framework has a corresponding mobile version: jquery Mobile, on the opportunistic use of jquery Mobile to develop the Web site (a netizen said: using htm5+ native JS development most efficient).

The jquery Mobile Framework provides panel widgit, which we only need to add a data-role= ' panel ' attribute to the Div, and the location of the div is required. If your panel is designed for use on a single page, the panel should be placed inside the page and behind the header or footer, if your pannel is designed for use with multiple pages, put it outside the page.

I need to use the panel to implement user login, registration or display user information, need to open this Panel on the entire site page, so I put this panel outside the page.

<DivData-role= "page">    <DivData-role= "header"></Div>    <DivData-role= "Ui-content"></Div>    <DivData-role= "Footer"></Div></Div><DivData-role= "Panel"ID= "Login-panel"></Div>

  The jquery mobile framework automatically initializes the panel that is placed within the page, and the panel outside the page does not need to be initialized manually, and if not initialized, the panel directly displays and overwrites the page.

            $(function() {                $ ("# Login-panel "). Panel ();             });         </script>    

The jquery framework pre-defines the default theme for page, and the elements within the page do not show usage themes, they inherit the page's default theme. The panel that is defined outside the page does not have any jquery mobile frame theme, so the display will be displayed in the original HTML style, and you will need to add the Data-theme= "a" attribute to the panel's div to display properly.

<DivData-role= "page">    <DivData-role= "header"></Div>    <DivData-role= "Ui-content"></Div>    <DivData-role= "Footer"></Div></Div><DivData-role= "Panel"ID= "Login-panel"Data-theme= "a"></Div>

jquery Mobile's external pannel

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.