Everything works fine except the animate click function.
I would like to have the background to animate when clicked.
I know that i can do the div tag in html and call that, but it is not what i want.
Can anyone tel me how it can be done with in the script?
if (numbers[i] == 1){
$('<div>1</div>').css({
background: "url(img/1.png)",
'background-size': '100% 100%',
'background-repeat': 'no-repeat'
})
.data( 'number', numbers[i] )
.attr( 'id', 'card'+numbers[i] )
.appendTo( '#cardPile' + pile[i] ).draggable({
containment: '#content',
stack: '#cardPile1 div',
cursor: 'move',
})
.click(function(){
$('<div>1</div>').animate({
height:'181px',
width:'169px',
top: '-30',
left: '-20', opacity: '0.4'
}, 1000)
});
}
any help would be appreciated.
When you click your first div you create a second:
Maybe you want to use the same in the animation?