Team:Virginia/Test

From 2014.igem.org

(Difference between revisions)
Line 32: Line 32:
<script type="text/javascript">
<script type="text/javascript">
-
 
+
$("#flipbook").turn({
-
function loadApp() {
+
  width: 400,
-
 
+
  height: 300,
-
// Create the flipbook
+
  autoCenter: true
-
 
+
-
$('.flipbook').turn({
+
-
// Width
+
-
 
+
-
width:1000,
+
-
+
-
// Height
+
-
 
+
-
height:600,
+
-
 
+
-
// Elevation
+
-
 
+
-
elevation: 50,
+
-
+
-
// Enable gradients
+
-
 
+
-
gradients: true,
+
-
+
-
// Auto center this flipbook
+
-
 
+
-
autoCenter: true
+
-
 
+
-
});
+
-
}
+
-
 
+
-
// Load the HTML4 version if there's not CSS transform
+
-
 
+
-
 
+
-
$(document).keydown(function(e){
+
-
 
+
-
var previous = 37, next = 39, esc = 27;
+
-
 
+
-
switch (e.keyCode) {
+
-
case previous:
+
-
 
+
-
// left arrow
+
-
$('.flipbook').turn('previous');
+
-
e.preventDefault();
+
-
 
+
-
break;
+
-
case next:
+
-
 
+
-
//right arrow
+
-
$('.flipbook').turn('next');
+
-
e.preventDefault();
+
-
 
+
-
break;
+
-
case esc:
+
-
+
-
$('.flipbook-viewport').zoom('zoomOut');
+
-
e.preventDefault();
+
-
 
+
-
break;
+
-
}
+
-
});
+
-
 
+
-
yepnope({
+
-
test : Modernizr.csstransforms,
+
-
yep: ['http://www.thebalancingact.com/assets/js/turn/lib/turn.js'],
+
-
nope: ['http://www.thebalancingact.com/assets/js/turn/lib/turn.html4.min.js'],
+
-
both: ['http://www.thebalancingact.com/assets/css/turn/basic/basic.css'],
+
-
complete: loadApp
+
});
});

Revision as of 04:23, 16 October 2014

Turn.js
Page 1
Page 2
Page 3
Page 4