除了动画点击功能外,一切正常。
我希望在单击时具有动画背景。
我知道我可以在 html 中做 div 标签并调用它,但这不是我想要的。
谁能告诉我如何在脚本中完成它?
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)
});
}
任何帮助,将不胜感激。