首頁  >  文章  >  web前端  >  jQuery移動移動web(4)_jquery

jQuery移動移動web(4)_jquery

WBOY
WBOY原創
2016-05-16 15:24:211090瀏覽

行動互聯網的發展,促進了各種各樣的行動Web框架。 jQuery Mobile 是一個針對觸控體驗的web UI 開發框架,很容易就可以把Web App 包裝成適合Android 與iOS等觸控式行動裝置的Javascript 函式庫,與HTML5結合可以很方便快速的開發出一款具有良好介面及使用者體驗的Web App,而且不需要安裝任何東西,只需將需要的*.js 和*.css 檔案直接包含到web 頁面中即可。

下拉式選單:

   設定label 元素的for 屬性為 select label 元素的文字內容作為選項的名稱 定義div元素並設定data-role 屬性值為 fieldcontain.

   <div data-role="controlgroup">
    <label for="select" class="select">请选择你的兴趣</label>
    <select name="select" id="select">
      <option>音乐</option>
      <option>电影</option>
      <option>体育</option>
      <option>旅游</option>
    </select>
   </div>

分組的選擇選單

   要在select 元素制定optgroup。  

<div data-role="controlgroup">
      <label for="select">请选择你的兴趣:</label>
      <select name="select" id="select" data-native-menu="true">
        <optgroup label="娱乐类"/>
        <option>音乐</option>
        <option>电影</option>
        <optgroup label="文体累"/>
        <option>体育</option>
        <option>旅游</option>
      </select>
     </div>

停用指定Option 資料項目的選擇選單

    <div data-role="controlgroup">
      <label for="select">请选择你的兴趣:</label>
      <select name="select" id="select" data-native-menu="true">
        <optgroup label="娱乐类"/>
        <option disabled="">音乐</option>
        <option>电影</option>
        <optgroup label="文体累"/>
        <option>体育</option>
        <option>旅游</option>
      </select>
   </div>

普通連線清單  

<div data-role="page">
      <header data-role="header">
        <h1>列表例</h1>
      </header>
      <div data-role="content">
        <ul data-role="listview" data-theme="g">
          <li><a href="#">List 1</a></li>
          <li><a href="#">List 2</a></li>
          <li><a href="#">List 3</a></li>
          <li><a href="#">List 4</a></li>
        </ul>
      </div>
   </div>

多層次巢狀清單。

   

<div data-role="page">
    <header data-role="header">
      <h1>列表例</h1>
    </header>
    <div data-role="content">
      <ul data-role="listview" data-theme="g">
        <li>
          <a href="#" data-add-back-btn="true">List 1</a>
          <p >这是第一层</p>
          <ul>
            <li>
              <a>subList 1 of 1</a>
              <a>subList 1 of 2</a>
              <a>subList 1 of 3</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="#" data-add-back-btn="true">List 2</a>
          <p >这是第二层</p>
          <ul>
            <li>
              <a>subList 2 of 1</a>
              <a>subList 2 of 2</a>
              <a>subList 2 of 3</a>
            </li>
          </ul>
        </li>
      <li>
        <a href="#" data-add-back-btn="true">List 3</a>
        <p >这是第三层</p>
        <ul>
          <li>
            <a>subList 3 of 1</a>
            <a>subList 3 of 2</a>
            <a>subList 3 of 3</a>
          </li>
        </ul>
    </li>
  </ul>
  </div>
   </div>

以上內容是小編給大家分享的jQuery mobile 行動web(4)的相關知識,希望大家喜歡。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn