programmatically changing webkit-transformation values in animation rules

前端 未结 7 1317
渐次进展
渐次进展 2020-11-28 04:52

I have this stylesheet:

        @-webkit-keyframes run {
            0% {
                -webkit-transform: translate3d(0px, 0px, 0px);
            }                


        
相关标签:
7条回答
  • 2020-11-28 05:36

    Well from your example it seems to me that CSS animations may be overkill. Use transitions instead:

    -webkit-transition: -webkit-transform .4s linear; /* you could also use 'all' instead of '-webkit-transform' */
    

    and then apply a new transform to the element via js:

    $("<yournode>")[0].style.webkitTransform = "translate3d(0px,"+ (height*i) +"px,0px)";
    

    It should animate that.

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