ionic modal 动画无效

有的人说需要引入css,我也引用了,结果还是不行,求助于各位

js

$ionicModal.fromTemplateUrl('tpl/detail.html', {
        scope: $scope,
        animation:'slide-in-up'
    }).then(function(modal) {
        $scope.modal = modal;
    });
    $scope.openModal = function(id) {
        $scope.detail=$scope.data.list[id];
        $ionicScrollDelegate.$getByHandle('detail').scrollTop();
        $scope.modal.show();
    };
    $scope.closeModal = function() {
        $scope.modal.hide({animation:'slide-in-left'});
    };
    //Cleanup the modal when we're done with it!
    $scope.$on('$destroy', function() {
        $scope.modal.remove();
    });
    // Execute action on hide modal
    $scope.$on('modal.hidden', function() {
        // Execute action
    });
    // Execute action on remove modal
    $scope.$on('modal.removed', function() {
        // Execute action
    });

css

@-webkit-keyframes slideInUp {
  0% {
    -webkit-transform: translate3d(100%, 0%, 0);
    -moz-transform: translate3d(100%, 0%, 0);
    transform: translate3d(100%, 0%, 0);
    opacity: 1; }

  100% {
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1; } }
阅读 6.4k
1 个回答

需要把template的内容放在他固定的容器里面

<ion-modal-view></ion-modal-view>

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题