zoukankan      html  css  js  c++  java
  • angualr 单页面跳转(仿weui切换动画)

    $scope.$on('$locationChangeStart', function(event, next, current) {

    setTimeout(function() {

    var hash = window.location.hash;

    if(current == next){

    if(hash == '#/'){

    $scope.pageClass = '';

    }

    states = JSON.parse(sessionStorage.getItem('hash')) || ['#/'];

    }else{

    if(states.indexOf(hash) == -1) {

    $scope.pageClass = 'a-fadeinR';

    states.push(hash);

    } else {

    $scope.pageClass = 'a-fadeinL';

    states.pop(hash)

    }

    sessionStorage.setItem('hash',JSON.stringify(states))

    }

    })

    });

     

     

     

     

    //切换动画

     

    @-webkit-keyframes fadeinR{

        0%{opacity:1;-webkit-transform:translateX(150px);}

        100%{opacity:1;-webkit-transform:translateX(0);}

    }

    @-moz-keyframes fadeinR{

        0%{opacity:1;-moz-transform:translateX(150px);}

        100%{opacity:1;-moz-transform:translateX(0);}

    }

    @-ms-keyframes fadeinR{

        0%{opacity:1;-ms-transform:translateX(150px);}

        100%{opacity:1;-ms-transform:translateX(0);}

    }

    @keyframes fadeinR{

        0%{opacity:1;transform:translateX(150px);}

        100%{opacity:1;transform:translateX(0);}

    }

    .a-fadeinR{

    -webkit-animation:fadeinR .5s;

    -moz-animation:fadeinR .5s;

    -ms-animation:fadeinR .5s;

    animation:fadeinR .5s;

    }

     

    @-webkit-keyframes fadeinL{

        0%{opacity:1;-webkit-transform:translateX(-150px);}

        100%{opacity:1;-webkit-transform:translateX(0);}

    }

    @-moz-keyframes fadeinL{

        0%{opacity:1;-moz-transform:translateX(-150px);}

        100%{opacity:1;-moz-transform:translateX(0);}

    }

    @-ms-keyframes fadeinL{

        0%{opacity:1;-ms-transform:translateX(-150px);}

        100%{opacity:1;-ms-transform:translateX(0);}

    }

    @keyframes fadeinL{

        0%{opacity:1;transform:translateX(-150px);}

        100%{opacity:1;transform:translateX(0);}

    }

    .a-fadeinL{

    -webkit-animation:fadeinL .5s;

    -moz-animation:fadeinL .5s;

    -ms-animation:fadeinL .5s;

    animation:fadeinL .5s;

    }

  • 相关阅读:
    [转]Linux FTP服务配置
    [转]手把手教你nginx下如何增加网站
    [转]linux一键安装web环境全攻略
    CentOS命令
    [转]Response对象的属性和方法
    beforeRouteLeave vue监听返回的使用方法
    ue项目浏览器出现卡顿及崩溃的原因查找与解决方案
    vue中,解决chrome下,的warning, Added nonpassive event listener to a scrollblocking ‘mousewheel‘ event 问题
    npm
    Java线程池使用案例
  • 原文地址:https://www.cnblogs.com/zyzhao/p/7641193.html
Copyright © 2011-2022 走看看