테스트 사이트 - 개발 중인 베타 버전입니다

AngularJS Animations 무엇이 필요합니까?

· 8년 전 · 1411
AngularJS Animations

무엇이 필요합니까?

애니메이션을위한 응용 프로그램을 준비하려면 AngularJS Animate 라이브러리를 포함해야합니다.

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.js"></script>

그런 다음 ngAnimate응용 프로그램 의 모듈을 참조해야합니다 .

<body ng-app="ngAnimate">
또는 응용 프로그램에 이름 ngAnimate이 있으면 응용 프로그램 모듈에 종속성으로 추가 합니다.


<body ng-app="myApp">

<h1>Hide the DIV: <input type="checkbox" ng-model="myCheck"></h1>

<div ng-hide="myCheck"></div>

<script>
var app = angular.module('myApp', ['ngAnimate']);
</script>


[전체소스]
<!DOCTYPE html>
<html>
<style>
div {
transition: all linear 0.5s;
background-color: lightblue;
height: 100px;
width: 100%;
position: relative;
top: 0;
left: 0;
}

.ng-hide {
height: 0;
width: 0;
background-color: transparent;
top:-200px;
left: 200px;
}

</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.js"></script>

<body ng-app="myApp">

<h1>Hide the DIV: <input type="checkbox" ng-model="myCheck"></h1>

<div ng-hide="myCheck"></div>

<script>
var app = angular.module('myApp', ['ngAnimate']);
</script>

</body>
</html>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
1356
1355
1354
1353
1352
1351
1350
1349
1348
1347
1346
1345
1344
1343
1342
1341
1340
1339
1338
1337
1336
1335
1334
1333
1332
1331
1330
1329
1328
1327