JQuery Mobile

構建於 jQuery 庫之上,是一個爲觸控優化的框架,用於建立移動 web 應用程序。適用於全部流行的智能手機和平板電腦。css

優勢:它會自動爲網頁設計交互的易用外觀,並在全部移動設計上保持一致。jquery

要使用 jQuery Mobile,首先須要在開發的界面中包含以下3個內容:web

<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>

基本結構:瀏覽器

<body>
<div data-role="page">----(data-role="page" 是顯示在瀏覽器中的頁面)

  <div data-role="header">----(data-role="header" 建立頁面上方的工具欄(經常使用於標題和搜索按鈕)) 
    <h1>歡迎訪問個人主頁</h1>
  </div>

  <div data-role="content">---- (data-role="content" 定義頁面的內容,好比文本、圖像、表單和按鈕,等等 )
    <p>我是一名移動開發者!</p>
  </div>

  <div data-role="footer">----(data-role="footer" 建立頁面底部的工具欄 )
    <h1>頁腳文本</h1>
  </div>

</div>
</body>
PS:  在頭部和底部添加data-position=」fixed」 屬性,能夠使頭部保持屏幕的頂部,底部部分在頁面的底部。

對話框是用來顯示信息或請求輸入的視窗類型。框架

如需在用戶點擊(輕觸)連接時建立一個對話框,請向該連接添加 data-rel="dialog"。工具

相關文章
相關標籤/搜索