mirror of
https://github.com/blasten/turn.js.git
synced 2025-06-04 14:59:18 +08:00
Added Single Display Demo
This commit is contained in:
parent
cd19d74c73
commit
d66bbb02d1
62
demos/magazine_single/index.html
Normal file
62
demos/magazine_single/index.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
|
||||
<script type="text/javascript" src="../../turn.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body{
|
||||
background:#ccc;
|
||||
}
|
||||
#magazine{
|
||||
width:576px;
|
||||
height:752px;
|
||||
}
|
||||
#magazine .turn-page{
|
||||
background-color:#ccc;
|
||||
background-size:100% 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="magazine">
|
||||
<div style="background-image:url(pages/01.jpg);"></div>
|
||||
<div style="background-image:url(pages/02.jpg);"></div>
|
||||
<div style="background-image:url(pages/03.jpg);"></div>
|
||||
<div style="background-image:url(pages/04.jpg);"></div>
|
||||
<div style="background-image:url(pages/05.jpg);"></div>
|
||||
<div style="background-image:url(pages/06.jpg);"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(window).ready(function() {
|
||||
$('#magazine').turn({
|
||||
display: 'single',
|
||||
acceleration: true,
|
||||
gradients: !$.isTouch,
|
||||
elevation:50,
|
||||
when: {
|
||||
turned: function(e, page) {
|
||||
console.log('Current view: ', $(this).turn('view'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(window).bind('keydown', function(e){
|
||||
|
||||
if (e.keyCode==37)
|
||||
$('#magazine').turn('previous');
|
||||
else if (e.keyCode==39)
|
||||
$('#magazine').turn('next');
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
demos/magazine_single/pages/01.jpg
Normal file
BIN
demos/magazine_single/pages/01.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
BIN
demos/magazine_single/pages/02.jpg
Normal file
BIN
demos/magazine_single/pages/02.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
BIN
demos/magazine_single/pages/03.jpg
Normal file
BIN
demos/magazine_single/pages/03.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 KiB |
BIN
demos/magazine_single/pages/04.jpg
Normal file
BIN
demos/magazine_single/pages/04.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 85 KiB |
BIN
demos/magazine_single/pages/05.jpg
Normal file
BIN
demos/magazine_single/pages/05.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
BIN
demos/magazine_single/pages/06.jpg
Normal file
BIN
demos/magazine_single/pages/06.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
Loading…
x
Reference in New Issue
Block a user