jQuery Mobile,jquerymobile

來源:互聯網
上載者:User

jQuery Mobile,jquerymobile

引用 jQuery Mobile,可以
jQuery Mobile CDN:

<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>

也可以下載下來

<head><link rel=stylesheet href=jquery.mobile-1.3.2.css><script src=jquery.js></script><script src=jquery.mobile-1.3.2.js></script></head>

實現一個最簡單的頁面

<!DOCTYPE html><html><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">  <div data-role="header">    <h1>標題</h1>  </div>  <div data-role="content">    <p>內容</p>  </div>  <div data-role="footer">    <h1>頁尾</h1>  </div></div></body></html>

HTML5 data-* 屬性用於通過 jQuery Mobile 為行動裝置建立“對觸控友好的”互動外觀。

在 jQuery Mobile,您可以在單一 HTML 檔案中建立多個頁面。
請通過唯一的 id 來分隔每張頁面,並使用 href 屬性來串連彼此:
每個都是一個page

<div data-role="page" id="pageone">  <div data-role="content">    <a href="#pagetwo">轉到頁面二</a>  </div></div><div data-role="page" id="pagetwo">  <div data-role="content">    <a href="#pageone">轉到頁面一</a>  </div></div>

在 jQuery Mobile 中建立按鈕
jQuery Mobile 中的按鈕可通過三種方法建立:
使用 元素
使用 元素
使用 data-role=”button” 的 元素

在頁尾設定了浮動後,若是設定了按鈕的類,就沒有效果了。

頭部若是設定成浮動和全屏,那麼點擊空白處能夠隱藏標題

<div data-role="header" data-position="fixed" data-fullscreen="true">

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.