Angular Animation Done Call Back

Developer
Size
2,520 Kb
Views
12,144

How do I make an angular animation done call back?

What is a angular animation done call back? How do you make a angular animation done call back? This script and codes were developed by Chris Sargent on 29 November 2022, Tuesday.

Angular Animation Done Call Back Previews

Angular Animation Done Call Back - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Angular Animation Done Call Back</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="card" ng-app="myApp" ng-controller="myCtrl"> <button ng-click="toggle()">Collapse The Div Below</button> <div class="collapsible" ng-if="showContent"> This div is collapsible with an auto-height. </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-animate.js'></script> <script src="js/index.js"></script>
</body>
</html>

Angular Animation Done Call Back - Script Codes CSS Codes

.collapsible { border: 1px solid red; padding: 50px; -webkit-transition: none; transition: none; -webkit-animation: none; animation: none; -webkit-transition: 2s ease all; transition: 2s ease all;
}
.collapsible.ng-enter,
.collapsible.ng-leave { -webkit-transition: 1s ease all; transition: 1s ease all; overflow: hidden!important;
}
.collapsible.ng-enter,
.collapsible.ng-leave.ng-leave-active { opacity: 0;
}
.collapsible.ng-leave,
.collapsible.ng-enter.ng-enter-active { opacity: 1;
}

Angular Animation Done Call Back - Script Codes JS Codes

angular.module('myApp', ['ngAnimate'])
.controller('myCtrl', function($scope) { $scope.showContent = false; $scope.toggle = function() { $scope.showContent = !$scope.showContent; }
})
.animation('.collapsible', ['$animateCss', function($animateCss) { return { enter: function(element, doneFn) { console.log('test'); var height = element[0].offsetHeight; var animation = $animateCss(element, { from: { height: '0px' }, to: { height: height + 'px' }, duration: 1, event: "enter", structural: true }); animation.start(); }, leave: function(element, doneFn) { var height = element[0].offsetHeight; var animation = $animateCss(element, { to: { height: '0px' }, from: { height: height + 'px' }, duration: 1, event: "leave", structural: true }); animation.start(); } }
}]);
Angular Animation Done Call Back - Script Codes
Angular Animation Done Call Back - Script Codes
Home Page Home
Developer Chris Sargent
Username ChrisSargent
Uploaded November 29, 2022
Rating 3
Size 2,520 Kb
Views 12,144
Do you need developer help for Angular Animation Done Call Back?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Sargent (ChrisSargent) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!