Team:Cornell/sandbox
From 2013.igem.org
(Difference between revisions)
Line 339: | Line 339: | ||
if (e.which == 40 || e.which == 39) { | if (e.which == 40 || e.which == 39) { | ||
if($("#second-last-screen").css('left') > '0') { //only scroll if we haven't reached the far right | if($("#second-last-screen").css('left') > '0') { //only scroll if we haven't reached the far right | ||
- | $(".parallax").each(function() { | + | $(".parallax, .screen").each(function() { |
var speed = parseInt($(this).data('speed'), 10); //in milliseconds | var speed = parseInt($(this).data('speed'), 10); //in milliseconds | ||
$(this).animate( { left: '-=100%' }, speed); //move to the right | $(this).animate( { left: '-=100%' }, speed); //move to the right | ||
Line 351: | Line 351: | ||
else if(e.which == 38 || e.which == 37) { | else if(e.which == 38 || e.which == 37) { | ||
if($("#first-screen").css('left') < '0') { //only scroll if we haven't reached the far left | if($("#first-screen").css('left') < '0') { //only scroll if we haven't reached the far left | ||
- | $(".parallax").each(function() { | + | $(".parallax, .screen").each(function() { |
var speed = parseInt($(this).data('speed'), 10); //in milliseconds | var speed = parseInt($(this).data('speed'), 10); //in milliseconds | ||
$(this).animate( { left: '+=100%' }, speed); //move to the left | $(this).animate( { left: '+=100%' }, speed); //move to the left |
Revision as of 19:15, 1 January 2014