jquery mobile 怎么实现滚动翻页
1个回答
2016-07-04 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
代码:直接访问没问题,从别的页面(不应用waypoint 的js页面)调整过来 waypoint无效
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>
<div data-role="page">
<div id="header" data-role="header">
<h1>My Title</h1>
</div><!-- /header -->
<div data-role="content">
<div class="content-primary">
<ul data-role="listview" id="list">
</ul>
</div>
</div><!-- /content -->
<div id="footer" data-role="footer">
<h1>My Footer</h1>
</div><!-- /header -->
<script>
var i = 0;
$(document).bind("pageshow", function(){
//console.log($('#footerel'));
//$('#header').waypoint(function (a, b) {
// console.log("header", a, b);
//});
for(; i<20; i++)
{
$("#list").append($("<li><a href=\"index.html\"><img src=\"#\" /><h3>" + i + "</h3><p>z</p></a></li>"));
}
$("#list").listview('refresh');
//alert('st');
$('#footer').waypoint(function (a, b) {
//alert('in');
$("#list").append($("<li><a href=\"index.html\"><img src=\"#\" /><h3>" + i++ + "</h3><p>z</p></a></li>"));
$("#list").listview('refresh');
$('#footer').waypoint({ offset: '100%' });
}, { offset: '100%' });
});
</script>
<script type="text/javascript" src="IPjquery-waypoints/waypoints.min.js"></script>
</div><!-- /page -->
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>
<div data-role="page">
<div id="header" data-role="header">
<h1>My Title</h1>
</div><!-- /header -->
<div data-role="content">
<div class="content-primary">
<ul data-role="listview" id="list">
</ul>
</div>
</div><!-- /content -->
<div id="footer" data-role="footer">
<h1>My Footer</h1>
</div><!-- /header -->
<script>
var i = 0;
$(document).bind("pageshow", function(){
//console.log($('#footerel'));
//$('#header').waypoint(function (a, b) {
// console.log("header", a, b);
//});
for(; i<20; i++)
{
$("#list").append($("<li><a href=\"index.html\"><img src=\"#\" /><h3>" + i + "</h3><p>z</p></a></li>"));
}
$("#list").listview('refresh');
//alert('st');
$('#footer').waypoint(function (a, b) {
//alert('in');
$("#list").append($("<li><a href=\"index.html\"><img src=\"#\" /><h3>" + i++ + "</h3><p>z</p></a></li>"));
$("#list").listview('refresh');
$('#footer').waypoint({ offset: '100%' });
}, { offset: '100%' });
});
</script>
<script type="text/javascript" src="IPjquery-waypoints/waypoints.min.js"></script>
</div><!-- /page -->
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询