我有一個居中的文本。它每4秒更換一次。 我希望當顯示文本時:它會從右邊(不透明度= 0)到中心(不透明度= 1), ,並且當文本被隱藏時,它會從中心(透明度= 1)到左邊(不透明度= 0)。淡入(從右到中)和離開(從中心到左側)
這是我的嘗試:
.fade.ng-enter {
transition:0.5s ease-out all;
opacity:0;
}
.fade.ng-enter.ng-enter-active {
opacity:1;
}
.fade.ng-leave {
transition:0.5s linear all;
opacity:1;
}
.fade.ng-leave.ng-leave-active {
opacity:0;
}
這是我codepen: https://codepen.io/anon/pen/jwNomv
任何幫助表示讚賞!
您不必依賴ng-animate。 – Paras