我有一个只显示其背景图像的 div:
.foo
{
height: 55px; width: 33px;
background: url('../images/foo.png');
background-repeat: no-repeat;
background-position:center;
background-size: contain;
-moz-background-size: contain;
color: transparent;
}
我想把它缩小到高度:1px;width: 33px,然后,当收缩完成时,通过在动画完成时调用回调函数将其从 DOM 中移除。
我试过 switchClass 但删除 .foo 会删除背景图像,并且 div 会立即缩小,而不是超过指定的持续时间,并且回调函数会立即触发。