allow card init animation to be controllable

This commit is contained in:
Ali Asaria 2011-05-29 15:06:18 -04:00
parent 481171bfec
commit b6e175c193
2 changed files with 6 additions and 2 deletions

View file

@ -134,7 +134,7 @@ function getMessage( m )
function drawNewCard(id, text, x, y, rot, colour, sticker) function drawNewCard(id, text, x, y, rot, colour, sticker, animationspeed)
{ {
//cards[id] = {id: id, text: text, x: x, y: y, rot: rot, colour: colour}; //cards[id] = {id: id, text: text, x: x, y: y, rot: rot, colour: colour};
@ -181,10 +181,13 @@ function drawNewCard(id, text, x, y, rot, colour, sticker)
} }
); );
var speed = Math.floor(Math.random() * 1000);
if (typeof(animationspeed) != 'undefined') speed = animationspeed;
$("#" + id).animate({ $("#" + id).animate({
left: x + "px", left: x + "px",
top: y + "px" top: y + "px"
}, Math.floor(Math.random() * 1000)); }, speed);
$("#" + id).hover( $("#" + id).hover(
function(){ function(){

View file

@ -1,3 +1,4 @@
/client/* /client/*
.DS_Store .DS_Store
/.git/* /.git/*
*.rdb