mirror of
https://github.com/dmuth/diceware.git
synced 2024-11-28 14:12:02 -05:00
Added fade out of rows and configurable delay.
This commit is contained in:
parent
20bb5a6e08
commit
222ae26549
1 changed files with 12 additions and 4 deletions
16
main.js
16
main.js
|
@ -56,19 +56,27 @@ jQuery(".dice_button").on("click", function(e) {
|
||||||
/**
|
/**
|
||||||
* This function displays each dice roll.
|
* This function displays each dice roll.
|
||||||
*
|
*
|
||||||
|
* @param array rows Array of rows of dice rolls that we had.
|
||||||
|
* @param object cb Our callback to fire when done
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function display_row(rows, cb) {
|
function display_row(rows, cb) {
|
||||||
|
|
||||||
|
var duration = 250;
|
||||||
|
var fadein_delay = 500;
|
||||||
|
|
||||||
if (rows.length) {
|
if (rows.length) {
|
||||||
//
|
//
|
||||||
// Display a row, then call ourselves again then done.
|
// Display a row, then call ourselves again then done.
|
||||||
//
|
//
|
||||||
var row = rows.shift();
|
var row = rows.shift();
|
||||||
row.hide().appendTo(".results").fadeIn(500, function() {
|
var tmp = row.hide().appendTo(".results")
|
||||||
jQuery(".results").append("<br clear=\"all\" />");
|
.delay(fadein_delay)
|
||||||
display_row(rows, cb);
|
.fadeIn(duration, function() {
|
||||||
});
|
jQuery(".results").append("<br clear=\"all\" />");
|
||||||
|
display_row(rows, cb);
|
||||||
|
})
|
||||||
|
.delay(1000).fadeOut(duration);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue