forked from metafizzy/infinite-scroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mobile.html
108 lines (78 loc) · 6.11 KB
/
mobile.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Infinite Scroll Testing</title>
<meta name="description" content="">
<meta name="author" content="">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="debug">
<a href="#" id="debug-trigger">+</a>
<h3>Debug bar</h3>
<nav id="debug-nav">
<a href="#" rel="destroy">Destroy</a>
<a href="#" rel="pause">Pause</a>
<a href="#" rel="resume">Resume</a>
<a href="#" rel="toggle">Toggle</a>
<a href="#" rel="scroll">Scroll</a>
<a href="#" rel="unbind">Unbind</span></a>
<a href="#" rel="bind">Bind</span></a>
<a href="#" rel="retrieve">Retrieve</a>
<a href="#" rel="cthullu">Invalid command</a>
<a href="#" rel="pause" data-arg="the-apocalypse">Invalid argument</a>
</nav>
</div>
<div id="content">
<h1>Infinite Scroll Testing</h1>
<p>One for all and all for one, Muskehounds are always ready. One for all and all for one, helping everybody. One for all and all for one, it's a pretty story. Sharing everything with fun, that's the way to be. One for all and all for one, Muskehounds are always ready. One for all and all for one, helping everybody. One for all and all for one, can sound pretty corny. If you've got a problem chum, think how it could be.</p>
<p>Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. Birds taught me to sing, when they took me to their king, first I had to fly, in the sky so high so high, so high so high so high, so - if you want to sing this way, think of what you'd like to say, add a tune and you will see, just how easy it can be. Treacle pudding, fish and chips, fizzy drinks and liquorice, flowers, rivers, sand and sea, snowflakes and the stars are free. La la la la la, la la la la la la la, la la la la la la la, la la la la la la la la la la la la la, so - Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name.</p>
<p>There's a voice that keeps on calling me. Down the road, that's where I'll always be. Every stop I make, I make a new friend. Can't stay for long, just turn around and I'm gone again. Maybe tomorrow, I'll want to settle down, Until tomorrow, I'll just keep moving on.</p>
<p>Top Cat! The most effectual Top Cat! Who's intellectual close friends get to call him T.C., providing it's with dignity. Top Cat! The indisputable leader of the gang. He's the boss, he's a pip, he's the championship. He's the most tip top, Top Cat.</p>
<p>Hong Kong Phooey, number one super guy. Hong Kong Phooey, quicker than the human eye. He's got style, a groovy style, and a car that just won't stop. When the going gets tough, he's really rough, with a Hong Kong Phooey chop (Hi-Ya!). Hong Kong Phooey, number one super guy. Hong Kong Phooey, quicker than the human eye. Hong Kong Phooey, he's fan-riffic!</p>
<p>Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name. Birds taught me to sing, when they took me to their king, first I had to fly, in the sky so high so high, so high so high so high, so - if you want to sing this way, think of what you'd like to say, add a tune and you will see, just how easy it can be. Treacle pudding, fish and chips, fizzy drinks and liquorice, flowers, rivers, sand and sea, snowflakes and the stars are free. La la la la la, la la la la la la la, la la la la la la la, la la la la la la la la la la la la la, so - Barnaby The Bear's my name, never call me Jack or James, I will sing my way to fame, Barnaby the Bear's my name.</p>
<p>There's a voice that keeps on calling me. Down the road, that's where I'll always be. Every stop I make, I make a new friend. Can't stay for long, just turn around and I'm gone again. Maybe tomorrow, I'll want to settle down, Until tomorrow, I'll just keep moving on.</p>
<p>Top Cat! The most effectual Top Cat! Who's intellectual close friends get to call him T.C., providing it's with dignity. Top Cat! The indisputable leader of the gang. He's the boss, he's a pip, he's the championship. He's the most tip top, Top Cat.</p>
<p>Hong Kong Phooey, number one super guy. Hong Kong Phooey, quicker than the human eye. He's got style, a groovy style, and a car that just won't stop. When the going gets tough, he's really rough, with a Hong Kong Phooey chop (Hi-Ya!). Hong Kong Phooey, number one super guy. Hong Kong Phooey, quicker than the human eye. Hong Kong Phooey, he's fan-riffic!</p>
</div>
<a id="next" href="mobile2.json">next page?</a>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='jquery-1.6.1.js'>\x3C/script>")</script>
<script src="debug.js"></script>
<script src="../jquery.infinitescroll.js"></script>
<script src="../behaviors/manual-trigger.js"></script>
<script>
var _renderItem = function(data) {
return "<p>Title :" + data.title + "</p>"
}
$('#content').infinitescroll({
// callback : function () { console.log('using opts.callback'); },
navSelector : "a#next:last",
nextSelector : "a#next:last",
itemSelector : "#content p",
debug : true,
dataType : 'json',
// behavior : 'twitter',
appendCallback : false, // USE FOR PREPENDING
// pathParse : function( pathStr, nextPage ){ return pathStr.replace('2', nextPage ); }
}, function( response ) {
var jsonData = response.results;
$theCntr = $("#content");
var newElements = "";
//var newItems = new Array();
for(var i=0;i<jsonData.length;i++) {
var item = $(_renderItem(jsonData[i]));
//item.css({ opacity: 0 });
$theCntr.append(item);
//newItems.push(item.attr('id'));
}
//_addMasonryItem(newItems);
});
</script>
</body>
</html>