【发布时间】:2015-10-14 03:02:17
【问题描述】:
我有一个类似 tinder 的单一视图,看起来像
<div class="list card animated slideInUp current-image-item">
<img src="{{imageSource}}">
<button ng-click="sendFeedback(true)"> ClickMe </button>
</div>
当我单击此按钮时,当前(唯一一张卡)应该上升并淡出。而且,我将更新控制器中 sendFeedback() 函数中的 imageSource 以指向另一个 url。然后保存 div 应该从下向上滑入。
我正在使用 animate.css 库来执行 slideInUp,我正在 sendFeedback() 中添加类似的内容。
var element = angular.element(document.querySelector('.current-image-item'));
element.addClass('fadeOutUp');
element.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
var randomItem = Math.round(Math.random() * ($scope.feed.length - 1));
element.removeClass('fadeOutUp');
// update current song in scope
$scope.imageSource = "http://google.com/img.png";
});
谁能帮我制作这个动画?
【问题讨论】:
-
问题是什么?还是问题?
-
@leo.fcx 我已经更新了上面的问题。基本上我正在将 animate.css 库与 ionic 集成,并且集成不起作用。
-
对答案的任何反馈将不胜感激。
标签: javascript angularjs ionic-framework ionic animate.css