zoukankan      html  css  js  c++  java
  • angularjs1--动画

    <!DOCTYPE HTML>
    <html ng-app="myApp">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>无标题文档</title>
        <style>
            .box{ width:200px; height:200px; background:red; }
        </style>
        <script src="jquery-1.11.1.js"></script>
        <script src="angular.min.js"></script>
        <script src="http://cdn.bootcss.com/angular.js/1.2.9/angular-animate.min.js"></script>
        <script>
            var m1 = angular.module('myApp',['ngAnimate']);
            m1.controller('firstController',['$scope',function($scope){
                $scope.bBtn = true;
            }]);
            m1.animation('.box',function(){
                return{
                    enter:function(element,done){
                        console.log(element);
                        console.log(done);
                        $(element).css({0,height:0});
                        ///   $(element).animate({0,height:0});
                        $(element).animate({200,height:200},1000,done);
                    },
                    leave:function(element,done){
                        $(element).animate({0,height:0},1000,done);
                    }
                }
            });
        </script>
    </head>
    <body>
    <div ng-controller="firstController">
        <input type="checkbox" ng-model="bBtn">
        <div ng-if="bBtn" class="box"></div>
    </div>
    </body>
    </html>
    <!DOCTYPE HTML>
    <html ng-app="myApp">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>无标题文档</title>
        <style>
            .box{ width:200px; height:200px; background:red; }
        </style>
        <script src="jquery-1.11.1.js"></script>
        <script src="angular.min.js"></script>
        <script src="http://cdn.bootcss.com/angular.js/1.2.9/angular-animate.min.js"></script>
        <script>
            var m1 = angular.module('myApp',['ngAnimate']);
            m1.controller('firstController',['$scope',function($scope){
                $scope.bBtn = true;
            }]);
            m1.animation('.box',function(){
                return{
                    addClass:function(element,Sclass,done){
    //                    console.log(element);
    //                    console.log(Sclass);
    //                    console.log(done);
                        $(element).animate({0,height:0},1000,done);
                    },
                    removeClass:function(element,Sclass,done){
                        $(element).css({0,height:0});
                        $(element).animate({200,height:200},1000,done);
                    }
                }
            });
        </script>
    </head>
    <body>
    <div ng-controller="firstController">
        <input type="checkbox" ng-model="bBtn">
        <div ng-show="bBtn" class="box"></div>
    </div>
    </body>
    </html>
  • 相关阅读:
    docker 入门9篇文章
    shell获取 linux 系统的位数
    docker 查看容器详细
    VirtualBox 运行失败
    export 命令 设置环境变量
    查看内核启动顺序 设置默认启动内核
    生成 git 密钥 步骤
    初始化 二维数组
    关于开发环境 git 重新部署
    git-版本管理工具的介绍+发展史+分布式版本控制系统和集中式版本控制系统的区别
  • 原文地址:https://www.cnblogs.com/yaowen/p/7241515.html
Copyright © 2011-2022 走看看