Home  >  Article  >  Web Front-end  >  jQuery mobile 移动web(4)_jquery

jQuery mobile 移动web(4)_jquery

WBOY
WBOYOriginal
2016-05-16 15:24:211090browse

The development of mobile Internet has given rise to various mobile Web frameworks. jQuery Mobile is a web UI development framework for touch experience. It can easily package Web App into a Javascript library suitable for touch screen mobile devices such as Android and iOS. Combined with HTML5, it can be easily and quickly developed with a good interface. and user experience Web App, and there is no need to install anything, just include the required *.js and *.css files directly into the web page.

Drop-down menu:

Set the for attribute of the label element to select. The text content of the label element is used as the name of the option. Define the div element and set the data-role attribute value to 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>

Group selection menu

It is necessary to specify the optgroup in the select element. ​

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

Disable the selection menu of the specified Option data item

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

Common connection list

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

Multiple levels of nested lists.

 

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

The above content is the relevant knowledge of jQuery mobile mobile web(4) shared by the editor. I hope you like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn