在div
使用类时ticker
,我想在用户s时删除pulse
CSS 动画类。ng-mouseenter
我没有仅针对ticker
div 的指令设置,但是在这种情况下是否有一种简单的方法可以删除或更新pulse
类?
标记
<ul>
<li ng-repeat="tik in tgh.tag.tickers">
<div class="tag-container" ng-mouseleave="tgh.leaveAssoTicker(tik)">
<div class="ticker"
ng-class="{'fade-1 pulse' : tgh.tag.mainSearch}"
ng-mouseenter="tgh.hoverAssoTicker(tik)"
ng-click="tgh.selectTicker(tik)">{{tik.ticker}}</div>
<ticker-hover ticker="tik"></ticker-hover>
</div>
</li>
</ul>
鼠标输入函数
function hoverAssoTicker(ticker, type) {
vs.tickerTagsHoverTimeout = $timeout(function() {
var theTicker = {};
if (ticker.ticker === undefined) {
theTicker.ticker = ticker;
} else {
theTicker.ticker = ticker.ticker;
}
ApiFactory.getTickerDetails(theTicker.ticker).then(function(data) {
ticker.longname = data.data.tickers[0].longname;
if (type === 'portfolio') {
ticker.removePortfolio = true;
}
else if (type === 'searched') {
ticker.addPortfolio = true;
}
else {
ticker.removePortfolio = false,
ticker.addPortfolio = false;
}
ticker.tickerHoverDisplay = true;
});
vs.closeTagsTikHoverTimer = $timeout(function() {
if (ticker.tickerHoverDisplay) ticker.tickerHoverDisplay = false;
}, 2000);
$rootScope.$broadcast(vs.closeTagsTikHoverTimer);
}, 500);
}