forked from justindarc/Pushpop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynamic-views-demo.html
37 lines (34 loc) · 1.33 KB
/
dynamic-views-demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Pushpop Dynamic Views Demo</title>
<link rel="stylesheet" href="externals/scrollkit/scrollkit.css">
<link rel="stylesheet" href="pushpop.css">
<script src="jquery-1.7.2.js"></script>
<script src="externals/scrollkit/scrollkit.js"></script>
<script src="pushpop.js"></script>
<script>
$(function() {
var viewStack = $('#root-view-stack')[0].viewStack;
$('#create-button').bind('click', function(evt) {
evt.preventDefault();
viewStack.pushNewView(function(newView) {
var $newViewElement = newView.$element;
$newViewElement.append('<p>This view was created dynamically and will remove itself from the DOM when popped!</p>');
$newViewElement.append('<a class="pp-button pp-pop" href="#">Go Back</a>');
});
});
});
</script>
</head>
<body>
<div class="pp-view-stack" id="root-view-stack">
<div class="pp-view sk-scroll-view" id="root-view" data-always-bounce-vertical="true">
<a class="pp-button" id="create-button" href="#">Create & Push New Dynamic View</a>
</div>
</div>
</body>
</html>