jquery - How to chain the css3 transition in agularjs -
here scenario,
when user click on button, need increase height of div
once div
reached height,
from child of div
each of span
need have opacity:1
, sequence (with delay between spans)
how this?
here code , demo:
var myapp = angular.module('myapp', []) myapp.controller('main', function($scope){ $scope.animate = false; $scope.animit = function () { $scope.animate = !$scope.animate; } }) <html> <head> </head> <body ng-app="myapp"> <div ng-controller="main"> <div ng-class="{'active' : animate}"> <span>testing1</span> <span>testing2</span> <span>testing3</span> </div> <button ng-click="animit()">click me</button> </div> </body> </html>
update step of required:
- make full height div
div
reach full height , start- first
span
fade in , that's done - next
span
fade in so.. - when user clicks again remove
active
div - when
div
reducing height, accodingly fade outspan
reverse order.
Comments
Post a Comment