0

切り替え時に表の行を上下にスライドさせようとしていますng-show。私はAngularJS v1.3.0-rc.5を使用してngAnimationおり、アプリにモジュールを含めましたが、常にトグルし、アニメーションしません。私は何か間違ったことをしていますか?

HTML コードは次のとおりです。

<tbody>
    <tr data-ng-repeat-start="employee in stafflist" ng-init="isToggled[$index]">
        <td><a href="#" data-ng-click="toggleEmployee($index)">{{employee.FULLNAME}}</a></td>
        <td>{{employee.WORKPHONE}}</td>
        <td>{{employee.OFFICE}}</td>
        <td>{{employee.DEPARTMENT}}</td>
        <td>{{employee.COUNTRY}}</td>
    </tr>
    <tr data-ng-repeat-end data-ng-show="isToggled[$index]" class="animate-show">
        <td colspan="5">
            <div class="employeeInfo">
                <img ng-src="EmployeeImage.aspx?p={{employee.PHOTOURL}}" />
                Employee info
            </div>
        </td>
    </tr>
</tbody>

トグル用の JavaScript は非常に基本的なもので、次のとおりです。

$scope.isToggled = [];
$scope.toggleEmployee = function (id) {
    $scope.isToggled[id] = !$scope.isToggled[id];
};

CSS アニメーション コードは次のとおりです。

.animate-show {
    line-height:40px;
    list-style:none;
    box-sizing:border-box;
}

.animate-show.ng-move,
.animate-show.ng-enter,
.animate-show.ng-leave {
    -webkit-transition:all linear 0.5s;
    transition:all linear 0.5s;
}

.animate-show.ng-leave.ng-leave-active,
.animate-show.ng-move,
.animate-show.ng-enter {
    opacity:0;
    max-height:0;
}

.animate-show.ng-leave,
.animate-show.ng-move.ng-move-active,
.animate-show.ng-enter.ng-enter-active {
    opacity:1;
    max-height:40px;
}
4

1 に答える 1