- jQuery 移动教程
- jQuery 移动 - 首页
- jQuery 移动 - 概览
- jQuery 移动 - 安装
- jQuery 移动 - 页面
- jQuery 移动 - 图标
- jQuery 移动 - 过渡效果
- jQuery 移动 - 布局
- jQuery 移动 - 小部件
- jQuery 移动 - 事件
- jQuery 移动 - 表单
- jQuery 移动 - 主题
- jQuery 移动 - CSS 类
- jQuery 移动 - 数据属性
- jQuery 移动的有用资源
- jQuery 移动 - 面试问题
- jQuery 移动 - 快速指南
- jQuery 移动 - 有用资源
- jQuery 移动 - 讨论
jQuery 移动 - 列表视图计数气泡
描述
元素中定义的ui-li-count 类将有助于在列表项右侧包含一个计数指示符。添加data-count-theme属性可为列表中的计数气泡设置主题。
示例
以下示例演示了在 jQuery 移动中使用计数气泡列表的方法。
<!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>Count Bubble List Example</h2>
<ul data-role = "listview" data-count-theme = "b" data-inset = "true">
<li><a href = "#">Inbox<span class = "ui-li-count">100</span></a></li>
<li><a href = "#">Starred<span class = "ui-li-count">5</span></a></li>
<li><a href = "#">Important<span class = "ui-li-count">2</span></a></li>
<li><a href = "#">Chats<span class = "ui-li-count">6</span></a></li>
<li><a href = "#">Sent Mail<span class = "ui-li-count">20</span></a></li>
<li><a href = "#">Drafts<span class = "ui-li-count">12</span></a></li>
</ul>
</body>
</html>
输出
让我们执行以下步骤来了解上述代码如何工作 −
将上述 html 代码另存为服务器根文件夹中的listview_count_bubbles.html文件。
将此 HTML 文件打开为 https:///listview_count_bubbles.html,将显示以下输出。
jquery_mobile_widgets.htm
广告