javascript - Making a flipbook using turn4js? -
i don't know i'm missing code doesn't work magazine. using turn4js plugin , it's first time plugin.and have searched lot can't find appropriate solution.no idea missing.there not information given or tutorial there through can learn this.
code:
body{ overflow:hidden; } #flipbook{ width:400px; height:300px; } #flipbook .page{ width:400px; height:300px; background-color:blue; line-height:300px; font-size:20px; text-align:center; } #flipbook .page-wrapper{ -webkit-perspective:2000px; -moz-perspective:2000px; perspective:2000px; } #flipbook .hard{ background:#ccc !important; color:#333; -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; -o-box-shadow:inset 0 0 5px #666; -ms-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px #666; font-weight:bold; } #flipbook .odd{ background:-webkit-gradient(linear, right top, left top, color-stop(0.95, #fff), color-stop(1, #dadada)); background-image:-webkit-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:-moz-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:-ms-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:-o-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:linear-gradient(right, #fff 95%, #c4c4c4 100%); -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px #666; } #flipbook .even{ background:-webkit-gradient(linear, left top, right top, color-stop(0.95, #fff), color-stop(1, #dadada)); background-image:-webkit-linear-gradient(left, #fff 95%, #dadada 100%); background-image:-moz-linear-gradient(left, #fff 95%, #dadada 100%); background-image:-ms-linear-gradient(left, #fff 95%, #dadada 100%); background-image:-o-linear-gradient(left, #fff 95%, #dadada 100%); background-image:linear-gradient(left, #fff 95%, #dadada 100%); -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px #666; }
<head> <title>email attachment</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="https://raw.github.com/blasten/turn.js/master/turn.js"></script> <link type="text/css" rel="stylesheet" href="jqtest.css" /> </head> <body> <div id="flipbook"> <div class="hard"> turn.js </div> <div class="hard"></div> <div> page 1 </div> <div> page 2 </div> <div> page 3 </div> <div> page 4 </div> <div class="hard"></div> <div class="hard"></div> </div> <script> $("#flipbook").turn({ width: 400, height: 300, autocenter: true }); </script> </body>
it working script link http://www.turnjs.com/lib/turn.min.js
body{ overflow:hidden; } #flipbook{ width:400px; height:300px; } #flipbook .page{ width:400px; height:300px; background-color:blue; line-height:300px; font-size:20px; text-align:center; } #flipbook .page-wrapper{ -webkit-perspective:2000px; -moz-perspective:2000px; perspective:2000px; } #flipbook .hard{ background:#ccc !important; color:#333; -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; -o-box-shadow:inset 0 0 5px #666; -ms-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px #666; font-weight:bold; } #flipbook .odd{ background:-webkit-gradient(linear, right top, left top, color-stop(0.95, #fff), color-stop(1, #dadada)); background-image:-webkit-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:-moz-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:-ms-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:-o-linear-gradient(right, #fff 95%, #c4c4c4 100%); background-image:linear-gradient(right, #fff 95%, #c4c4c4 100%); -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px #666; } #flipbook .even{ background:-webkit-gradient(linear, left top, right top, color-stop(0.95, #fff), color-stop(1, #dadada)); background-image:-webkit-linear-gradient(left, #fff 95%, #dadada 100%); background-image:-moz-linear-gradient(left, #fff 95%, #dadada 100%); background-image:-ms-linear-gradient(left, #fff 95%, #dadada 100%); background-image:-o-linear-gradient(left, #fff 95%, #dadada 100%); background-image:linear-gradient(left, #fff 95%, #dadada 100%); -webkit-box-shadow:inset 0 0 5px #666; -moz-box-shadow:inset 0 0 5px #666; box-shadow:inset 0 0 5px #666; }
<head> <title>email attachment</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="http://www.turnjs.com/lib/turn.min.js"></script> <link type="text/css" rel="stylesheet" href="jqtest.css" /> </head> <body> <div id="flipbook"> <div class="hard"> turn.js </div> <div class="hard"></div> <div> page 1 </div> <div> page 2 </div> <div> page 3 </div> <div> page 4 </div> <div class="hard"></div> <div class="hard"></div> </div> <script> $("#flipbook").turn({ width: 400, height: 300, autocenter: true }); </script> </body>
Comments
Post a Comment