2017-06-06 90 views
0

我有一個按鈕的字體真棒圖標,它切換fa-searchfa-spinner之間的圖標,ng-class(當用戶鍵入的東西在相應的輸入,它會嘗試自動完成,運行的AJAX請求,並顯示微調):過渡延遲不與納克級的工作

<button type="submit" class="btn btn-primary"> 
    <i id="metasearch-icon" style="width: 15px;" ng-class="['fa', {'fa-spinner fa-pulse': loadingLocations, 'fa-search': !loadingLocations}]"></i> 
    <span class="hidden-xs-inline">Search</span> 
</button> 

enter image description here

然而,這個實現它閃爍太快了,我想至少0.25秒顯示微調。因此,我想介紹一個transition-delay,但它不起作用:

#metasearch-icon.fa-spinner-add, 
#metasearch-icon.fa-spinner-remove { 
    transition-delay: 0.25s !important; 
    transition: 1s linear all !important; 
    background: red !important; 
}; 

我在做什麼錯?

回答

1

聲明轉換後,將屬性transition-delay

#metasearch-icon.fa-spinner-add, 
#metasearch-icon.fa-spinner-remove { 
    transition: 1s linear all !important; 
    transition-delay: 0.25s !important; 
    background: red !important; 
};