Team:Cornell/sandbox

From 2013.igem.org

(Difference between revisions)
Line 328: Line 328:
if (e.which == 40 || e.which == 39) {  
if (e.which == 40 || e.which == 39) {  
$(".parallax").each(function() {
$(".parallax").each(function() {
-
var speed = 100 * parseInt($(this).data('speed'), 10);
+
var speed = 10 * parseInt($(this).data('speed'), 10);
$(this).animate( { left: '-=100%' }, speed); //move to the right
$(this).animate( { left: '-=100%' }, speed); //move to the right
});
});
Line 336: Line 336:
else if(e.which == 38 || e.which == 37) {
else if(e.which == 38 || e.which == 37) {
$(".parallax").each(function() {
$(".parallax").each(function() {
-
var speed = 100 * parseInt($(this).data('speed'), 10);
+
var speed = 10 * parseInt($(this).data('speed'), 10);
$(this).animate( { left: '+=100%' }, speed); //move to the left
$(this).animate( { left: '+=100%' }, speed); //move to the left
});
});
return false; //prevent more keydown events from firing
return false; //prevent more keydown events from firing
}
}
-
});
 
-
 
-
$("h1").click( function() {
 
-
$(".parallax").each(function() {
 
-
var speed = 10 * parseInt($(this).data('speed'), 10);
 
-
alert(speed);
 
-
$(this).animate( { left: '-=100%' }, speed); //move to the right
 
-
});
 
});
});
     });
     });

Revision as of 01:50, 30 December 2013

Parallax Test

Whee

Project