【发布时间】:2015-12-09 07:07:35
【问题描述】:
我正在开发一个 jquery 移动应用程序,我想要实现的是:当页面保持空闲 3 秒时,它应该自动从第 1 页移动到第 2 页,当您在第 2 页时它仍然保持空闲 3 秒秒它应该移动到 page3 等等等等第四。谁能帮我写一个脚本。
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header">
<h1>Page1</h1>
</div>
<div data-role="content">This is page 1</div>
<div data-role="footer">
<h4>Footer</h4>
</div>
</div>
<p>
<div data-role="page" id="page2">
<div data-role="header">
<h1>Page 2</h1>
</div>
<div data-role="content">This is page 2</div>
<div data-role="footer">
<h4>Footer</h4>
</div>
</div>
</p>
<p>
<div data-role="page" id="page3">
<div data-role="header">
<h1>Page 3</h1>
</div>
<div data-role="content">This is page 3</div>
<div data-role="footer">
<h4>Footer</h4>
</div>
</div>
<p>
<div data-role="page" id="page4">
<div data-role="header">
<h1>Page 4</h1>
</div>
<div data-role="content">This is page 4</div>
<div data-role="footer">
<h4>Footer</h4>
</div>
</div>
</p>
</body>
</html>
这是我的页面的一个小提琴
【问题讨论】:
-
闲置怎么定义?
-
我在你的小提琴上看不到 JS。您是否构建了路由和导航功能?