/
callbacks.html
121 lines (104 loc) · 3.52 KB
/
callbacks.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
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pagePiling.js plugin - Callbacks</title>
<meta name="author" content="Alvaro Trigo Lopez" />
<meta name="description" content="pagePiling.js plugin by Alvaro Trigo." />
<meta name="keywords" content="pile,piling,piling.js,stack,pages,scrolling,stacking,touch,fullpile,scroll,plugin,jquery" />
<meta name="Resource-type" content="Document" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Lato:300,400,700" />
<link rel="stylesheet" type="text/css" href="../jquery.pagepiling.css" />
<link rel="stylesheet" type="text/css" href="examples.css" />
<!--[if IE]>
<script type="text/javascript">
var console = { log: function() {} };
</script>
<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="../jquery.pagepiling.min.js"></script>
<script type="text/javascript">
var deleteLog = false;
$(document).ready(function() {
$('#pagepiling').pagepiling({
menu: '#menu',
anchors: ['page1', 'page2', 'page3'],
sectionsColor: ['#bfda00', '#2ebe21', '#2C3E50', '#51bec4'],
onLeave: function(index, nextIndex, direction){
if(deleteLog){
$('#callbacksDiv').html('');
}
$('#callbacksDiv').append('<p>onLeave - index:' + index + ' nextIndex:' + nextIndex + ' direction:' + direction + '</p>')
},
afterRender: function(){
$('#callbacksDiv').append('<p>afterRender</p>');
},
afterLoad: function(anchorLink, index){
$('#callbacksDiv').append('<p>afterLoad - anchorLink:' + anchorLink + " index:" + index + '</p>');
//section 2
if(index == 2){
//moving the image
$('#section2').find('.intro').delay(100).animate({
left: '0%'
}, 1500, 'easeOutExpo', function(){
$('#section2').find('p').first().fadeIn(700, function(){
$('#section2').find('p').last().fadeIn(600);
});
});
}
//section 3
if(anchorLink == 'page3'){
//section 3
$('#section3').find('.intro').delay(100).animate({
left: '0%'
}, 1500, 'easeOutExpo');
}
deleteLog = true;
}
});
});
</script>
<style>
#section2 .intro{
left: -150%;
position: relative;
}
#section2 p{
display: none;
}
#section3 .intro{
left: 140%;
position: relative;
}
</style>
</head>
<body>
<ul id="menu">
<li data-menuanchor="page1" class="active"><a href="#page1">Page 1</a></li>
<li data-menuanchor="page2"><a href="#page2">Page 2</a></li>
<li data-menuanchor="page3"><a href="#page3">Page 3</a></li>
</ul>
<div style="position:fixed;top:50px;left:50px;color:white;z-index:999;" id="callbacksDiv"></div>
<div id="pagepiling">
<div class="section" id="section1">
<h1>Callbacks</h1>
<p>Totally open to your imagination!</p>
<br />
</div>
<div class="section" id="section2">
<div class="intro">
<h1>Feel free</h1>
<p>All the callbacks you need to do whatever you need.</p>
<p>Just what you would expect.</p>
</div>
</div>
<div class="section" id="section4">
<div class="intro">
<h1>Ideal for animations</h1>
<p>Total control over your website.</p>
</div>
</div>
</div>
</body>
</html>