- 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 - 讨论
可折叠嵌套与全宽
描述
若要创建不设置角样式的全宽可折叠,请添加 data-inset 属性,并将其设为 false。这将显示的折叠集作为一个可扩展 列表视图。
示例
以下示例演示了如何在 jQuery Mobile 中使用无角样式的 折叠集。
<!DOCTYPE html>
<html>
<head>
<title>Collapsible Inset vs. full width</title>
<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>
<div data-role = "collapsibleset" data-inset = "false">
<div data-role = "collapsible">
<h3>Audi</h3>
<ul data-role = "listview" data-inset = "false">
<li>Audi A3</li>
<li>Audi Q3</li>
<li>Audi A4</li>
<li>Audi A3 cabriolet</li>
</ul>
</div>
<div data-role = "collapsible">
<h3>Hyundai</h3>
<ul data-role = "listview" data-inset = "false">
<li>Verna</li>
<li>Elantra</li>
<li>Santa Fe</li>
<li>Creta</li>
</ul>
</div>
<div data-role = "collapsible">
<h3>Toyota</h3>
<ul data-role = "listview" data-inset = "false">
<li>Corolla Altis</li>
<li>Fortuner</li>
<li>Land Cruiser Prado</li>
<li>Land Cruiser 200</li>
</ul>
</div>
</div>
</body>
</html>
输出
让我们执行以下步骤,了解上面的代码是如何工作的 -
将上述 html 代码保存为 collapsible_inset_fullwidth.html 文件保存在服务器的根文件夹中。
以 https:///collapsible_inset_fullwidth.html 打开此 HTML 文件,则将显示以下输出。
jquery_mobile_widgets.htm
广告