转换延迟不适用于ng-class

时间:2017-06-06 11:34:15

标签: angularjs css-transitions ng-animate

我在按钮上有一个字体真棒图标,它在 self.chatLabel.textInsets = UIEdgeInsets.init(top: 10, left: 10, bottom: 10, right: 10) fa-search图标之间切换fa-spinner(当用户在相应的输入中输入内容时,它会尝试自动完成,运行一个AJAX请求并显示微调器:

ng-class

enter image description here

但是,使用此实现它会闪烁太快,我想显示微调器至少0.25秒。因此,我想介绍一个<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> ,但它不起作用:

transition-delay

我做错了什么?

1 个答案:

答案 0 :(得分: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;
};