forked from mjromper/jbackbone-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
59 lines (50 loc) · 1.62 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width, minimum-scale=1.0, maximum-scale=1.0"/>
<title>JBackbone Sample</title>
<link rel="stylesheet" type="text/css" media="screen, projection" href="styles-backbone.css" />
<script type="text/javascript" src="jbackbone-mobile.js"></script>
</head>
<!-- How to use it: -->
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
/**
IMPORTANT!!!!!
1. Read instructions before
2. JUST MODIFY THIS SECTION ADDING YOUR PAGES TO THE LIST BELOW
**/
var config = {
pages:[
'sample-menu.html',
'sample-menu2.html',
'sample-page1.html',
'sample-page2.html',
'sample-page3.html',
'sample-subpage-l1.html',
'sample-subpage-l2.html'
],
MENU_MARGIN: 80 //Margin it leaves on the menu after sliding.
};
/** Track all page initialisation **/
jbackbone.addPageInitListener(function(newPage){
console.log('Page was initialised: '+newPage);
},'sample-page2');
jbackbone.init(config);
/** Track all page changes change **/
jbackbone.addPageChangeListener(function(oldPage,newPage){
console.log('Page changed from '+oldPage+' to '+newPage);
});
/** Track specific page change **/
jbackbone.addPageChangeListener(function(oldPage,newPage){
console.log('Special page is here!');
},'sample-page2');
}, false);
</script>
<body>
<div id="binder">
<div id="slider"></div>
</div>
</body>
</html>