CSS3 transforms and transitions (Webkit)

后端 未结 1 574
遥遥无期
遥遥无期 2021-02-02 06:19

Consider the following fiddle

p {
  -webkit-transform: translate(-100%, 0);
     -moz-transform: translate(-100%, 0);
      -ms-transform: translate(-100%, 0);
          


        
相关标签:
1条回答
  • 2021-02-02 06:57

    Add the vendor prefix in the transitions:

    p {
      -webkit-transform: translate(-100%, 0);
         -moz-transform: translate(-100%, 0);
          -ms-transform: translate(-100%, 0);
           -o-transform: translate(-100%, 0);
              transform: translate(-100%, 0);
      -webkit-transition: -webkit-transform 1s ease-in; /* Changed here */ 
         -moz-transition: -moz-transform 1s ease-in;
           -o-transition: -o-transform 1s ease-in;
              transition: transform 1s ease-in;
    }
    
    a:hover + p {
      -webkit-transform: translate(0, 0);
         -moz-transform: translate(0, 0);
          -ms-transform: translate(0, 0);
           -o-transform: translate(0, 0);
              transform: translate(0, 0);
    }
    

    Update (05/06/2014)

    To answer some comments, the reason for omitting -ms-transition, is that it has never existed.

    Check:

    Can I Use? Transitions,

    Can I Use? Transforms,

    MDN transitions,

    MDN transforms

    0 讨论(0)
提交回复
热议问题