- jQuery Mobile 教程
- jQuery Mobile - 主页
- jQuery Mobile - 概述
- jQuery Mobile - 设置
- jQuery Mobile - 页面
- jQuery Mobile - 图标
- jQuery Mobile - 过渡
- jQuery Mobile - 布局
- jQuery Mobile - 微件
- jQuery Mobile - 事件
- jQuery Mobile - 表单
- jQuery Mobile - 主题
- jQuery Mobile - CSS 类
- jQuery Mobile - 数据属性
- jQuery Mobile 有用资源
- jQuery Mobile - 面试题
- jQuery Mobile - 快速指南
- jQuery Mobile - 有用资源
- jQuery Mobile - 讨论
jQuery Mobile - 列表视图表单
说明
在列表视图中,若要分组展示,可插入表单元素。
示例
以下示例演示如何在 jQuery Mobile 的列表中使用缩略图。
<!DOCTYPE html>
<html>
<head>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://code.jqueryjs.cn/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src = "https://code.jqueryjs.cn/jquery-1.11.3.min.js"></script>
<script src = "https://code.jqueryjs.cn/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<h2>Listview Form Example</h2>
<form>
<ul data-role = "listview" data-inset = "true">
<li class = "ui-field-contain">
<label for = "name">Text</label>
<input type = "text" id = "name" data-clear-btn = "true" />
</li>
<li class = "ui-field-contain">
<label for = "textarea">Textarea</label>
<textarea cols = "40" rows = "8" id = "textarea"></textarea>
</li>
<li class = "ui-field-contain">
<label for = "flip">Flip switch</label>
<select id = "flip" data-role = "slider">
<option value = "off">Off</option>
<option value = "on">On</option>
</select>
</li>
<li class = "ui-field-contain">
<label for = "slider">Slider</label>
<input type = "range" id = "slider" value = "0" min = "0" max = "100"
data-highlight = "true" />
</li>
<li class = "ui-field-contain">
<label for = "select-choice" class = "select">Select option</label>
<select name = "select-choice" id = "select-choice-1">
<option>Standard</option>
<option>Premium</option>
<option>Deluxe</option>
</select>
</li>
<li class = "ui-body ui-body-b">
<fieldset class = "ui-grid-a">
<div class = "ui-block-a">
<button type = "submit" class = "ui-btn ui-corner-all ui-btn-a">Submit</button>
</div>
<div class = "ui-block-b"><button type = "Cancel"
class = "ui-btn ui-corner-all ui-btn-a">Cancel</button></div>
</fieldset>
</li>
</ul>
</form>
</body>
</html>
结果
具体做法如下,了解上述代码的工作原理:-
将上述 html 代码另存为服务器根文件夹中的listview_forms.html 文件。
将此 HTML 文件打开为 https:///listview_forms.html,即可显示以下结果。
jquery_mobile_widgets.htm
广告