From 8fdb7fd030702a1da7133f6beb92580a0e84c0ed Mon Sep 17 00:00:00 2001 From: Douglas Muth Date: Mon, 27 Apr 2015 20:57:03 -0400 Subject: [PATCH] Changed fading so that only one row of dice is visible at once. --- main.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.js b/main.js index 1d8538f..61e3d0a 100644 --- a/main.js +++ b/main.js @@ -97,8 +97,7 @@ jQuery(".dice_button").on("click", function(e) { function display_row(rows, cb) { var duration = 250; - var fadein_delay = 500; - var fadeout_delay = 400; + var fadeout_delay = 500; if (rows.length) { // @@ -106,11 +105,14 @@ function display_row(rows, cb) { // var row = rows.shift(); var tmp = row.hide().appendTo(".results") - .delay(fadein_delay) .fadeIn(duration, function() { - display_row(rows, cb); - }) - .delay(fadeout_delay).fadeOut(); + + jQuery(this).delay(fadeout_delay) + .fadeOut(fadeout_delay, function() { + display_row(rows, cb); + }); + + }); } else { // @@ -179,9 +181,9 @@ function is_mobile() { // jQuery("#roll_dice").on("click", function(e) { - var target_height = 300; + var target_height = 200; if (is_mobile()) { - target_height = 1000; + target_height = 300; } jQuery(".results").animate({height: target_height}, 400);