webkit translateX animation is rolling back to initial position

后端 未结 4 605
轻奢々
轻奢々 2021-02-05 13:08

I am trying to do a images gallery for mobile webkit,

The only way it is actually fast enough is using the hardware accelerated translateX .

My problem is that

4条回答
  •  有刺的猬
    2021-02-05 13:43

    Do not use webkit animation for this as it comes back to the default values once played. Instead define

    .slideGalleft{
        -webkit-transition: -webkit-transform 1s linear;
        -webkit-transform: translateX(0%);
    }
    

    and using Javascript, either set -webkit-transform: translateX(100%); or add a CSS class to your element which set the final transform value and webkit will animate it properly

提交回复
热议问题