问答详情
源自:2-7 导航页背影动画制作(animation制作动画)

h2为什么按照这个代码写完,没有效果

http://img.mukewang.com/55cc663e0001e21f19840722.jpgh2为什么按照这个代码写完,没有效果

提问者:明哥就是神 2015-08-13 17:41

个回答

  • 饭粒宝宝
    2016-10-21 15:20:13

    @符号后面写成-webkit-,-moz-,-ms-之后,大括号里面的也应该写成一样的,你的全是-webkit-

  • 饭粒宝宝
    2016-10-21 15:17:39

    #st-contrl-1:checked~.st-scroll #st-panel-1 h2,

    #st-contrl-2:checked~.st-scroll #st-panel-2 h2,

    #st-contrl-3:checked~.st-scroll #st-panel-3 h2,

    #st-contrl-4:checked~.st-scroll #st-panel-4 h2,

    #st-contrl-5:checked~.st-scroll #st-panel-5 h2{

        -webkit-animation:moveDown 0.6s ease-in-out 0.2s backwards;

        -o-animation:moveDown 0.6s ease-in-out 0.2s backwards;

        -ms-animation:moveDown 0.6s ease-in-out 0.2s backwards;

        -moz-animation:moveDown 0.6s ease-in-out 0.2s backwards;

        animation:moveDown 0.6s ease-in-out 0.2s backwards;


    }

    @-webkit-keyframes moveDown{

    0%{

    -webkit-transform:translateY(-40px);

    opacity:0;

    }

    100%{

    -webkit-transform:translateY(0px);

    opacity:1;

    }

    }

    @-ms-keyframes moveDown{

    0%{

    -ms-transform:translateY(-40px);

    opacity:0;

    }

    100%{

    -ms-transform:translateY(0px);

    opacity:1;

    }

    }


    @-o-keyframes moveDown{

    0%{

    -o-transform:translateY(-40px);

    opacity:0;

    }

    100%{

    -o-transform:translateY(0px);

    opacity:1;

    }

    }


    @-moz-keyframes moveDown{

    0%{

    -moz-transform:translateY(-40px);

    opacity:0;

    }

    100%{

    -moz-transform:translateY(0px);

    opacity:1;

    }

    }


    @keyframes moveDown{

    0%{

    transform:translateY(-40px);

    opacity:0;

    }

    100%{

    transform:translateY(0px);

    opacity:1;

    }

    }


  • 爱从零开始0
    2016-08-30 10:24:01

    我也是,代码没有问题,就是不出效果!!!急!!

  • qq_云破月来_03319603
    2016-06-30 19:54:03

    怎么换?


  • 菜鼻子尖
    2015-11-22 04:46:31

    错了,可能是是浏览器的地址不是index.html,而是重载时的index.html#st-panel-2什么的,换成index.html就好了

  • 菜鼻子尖
    2015-11-22 04:32:14

    先选最后一个页面,其他页面才会有效果,汗一个

  • 明哥就是神
    2015-08-13 17:44:01

    #st-control-1:checked ~ .st-scroll #st-panel-1 h2,
    #st-control-2:checked ~ .st-scroll #st-panel-2 h2,
    #st-control-3:checked ~ .st-scroll #st-panel-3 h2,
    #st-control-4:checked ~ .st-scroll #st-panel-4 h2,
    #st-control-5:checked ~ .st-scroll #st-panel-5 h2{ 
    -webkit-animation:moveDown 0.6s ease-in-out 0.2s backwards;
    -moz-animation:moveDown 0.6s ease-in-out 0.2s backwards;
    -o-animation:moveDown 0.6s ease-in-out 0.2s backwards;
    -ms-animation:moveDown 0.6s ease-in-out 0.2s backwards;
    animation:moveDown 0.6s ease-in-out 0.2s backwards;}
    
    @-webkit-keyframes moveDown{0%{ -webkit-transform:translateY(-40px); opacity:0;}100%{ -webkit-transform:translateY(0); opacity:1;}}
    @-moz-keyframes moveDown{0%{ -webkit-transform:translateY(-40px); opacity:0;}100%{ -webkit-transform:translateY(0); opacity:1;}}
    @-o-keyframes moveDown{0%{ -webkit-transform:translateY(-40px); opacity:0;}100%{ -webkit-transform:translateY(0); opacity:1;}}
    @-ms-keyframes moveDown{0%{ -webkit-transform:translateY(-40px); opacity:0;}100%{ -webkit-transform:translateY(0); opacity:1;}}
    @keyframes moveDown{0%{ -webkit-transform:translateY(-40px); opacity:0;}100%{ -webkit-transform:translateY(0); opacity:1;}}