jQuery Mobile 是一個用來構建跨平台移動web應用程式的新UI架構,具有使用簡單的特點。在短短几分鐘內,你可以建立出能夠在當今可用的近乎所有手機、平板電腦、台式機和電子書閱讀程式裝置上啟動並執行最佳化行動裝置 App程式。 jQuery Mobile具備的一些重要特性: 1. 通用訪問; 2. 跨所有移動平台的統一UI 3. 簡化的標記驅動的開發 4. 漸進式增強 5. 響應式設計 6. 可主體化的設計 7. 可訪問性 基本的模版頁面: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Page Template</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>Page Header</h1> </div> <div data-role="content"> <p>Hello jQuery Mobile!</p> </div> <div data-role="footer" data-position="fixed"> <h4>Page Footer</h4> </div></div> </body></html> device-width值表示,讓內容擴充到螢幕的整個寬度;initial-scale設定了用來查看Web頁面的初始縮放百分比或者縮放因數。 jQuery Mobile 的css會為所有的A級和B級瀏覽器應用風格的最佳化,可以根據需要自訂或添加自己的CSS jQuery 庫是jQuery Mobile 的一個核心依賴,如果app需要更多的動態行為,則需要在移動頁面中使用jQuery的核心API;www.2cto.com jQuery Mobile Javascript庫必須在jQuery和任何可能存在的自訂指令碼之後聲明。 data-role="header"是頁首或者標題列,該屬性是可選的; data-role="content"是內容主體的封裝容器,該屬性是可選的。 data-role="footer"包含頁尾欄,該屬性是可選的。