jQuery mobile 编写APP侧边导航分类页面代码
时间: 2023-08-15 09:03:17 浏览: 57
以下是一个简单的 jQuery Mobile APP 侧边导航分类页面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>分类页面</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>分类页面</h1>
<a href="#nav-panel" data-icon="bars" data-iconpos="notext" data-shadow="false" data-iconshadow="false">菜单</a>
<div data-role="panel" id="nav-panel" data-display="overlay">
<ul data-role="listview">
<li><a href="#">分类1</a></li>
<li><a href="#">分类2</a></li>
<li><a href="#">分类3</a></li>
</ul>
</div>
</div>
<div data-role="content">
<p>分类页面内容</p>
</div>
</div>
</body>
</html>
```
在这个代码示例中,我们使用了 jQuery Mobile 框架中的 Panel 组件,实现了侧边导航菜单。菜单按钮位于页面顶部的标题栏上,点击按钮可以打开侧边导航菜单。菜单中包括三个分类,用户可以点击分类进入该分类的详细页面。此外,我们还添加了一个内容区域,用于展示分类页面的具体内容。