angularjs を使用しており、モデル プロパティが変更されるたびにアニメーションをトリガーしようとしています。私のコントローラー:
function myCtrl($scope) {
$scope.data.counter = 0;
$scope.addCount = function() {
$scope.data.counter ++;
};
}
私のHTML:
<div ng-controller="myCtrl">
<button ng-click="addCount()">add count</button>
<div class="bgimage"></div>
</div>
私のCSS:
.bgimage {
background-image: url('../images/a.png');
background-position: right;
background-size: 16px 14px;
width: 16px;
height: 14px;
}
.bgimage.pulse {
-webkit-animation: pulse 1s both;
-moz-animation: pulse 1s both;
-o-animation: pulse 1s both;
animation: pulse 1s both;
}
「カウント」が変化するたびに、「bgimage」要素が「パルス化」されるようにしたいと考えています。
何か案が?