简体   繁体   中英

jQuery, CSS, -webkit-transform: NO animation

I am using code to change the -webkit-transform property of an element. However, I want to do this WITHOUT the transition animation playing: eg I want to go from transformX(-300px) to transformX(0) without a slide in-between. This is the code I have so far, but it is ineffective. I have to have "list-style-type" set to none otherwise the step function will not run.

$("#slider > ul").animate({"list-style-type": "none"}, {step: 
function(now, fx) {
    $(this).css('-webkit-transform', 'translateX(0)')
} 
}); 

Any ideas?

做就是了

$("#slider > ul").css('-webkit-transform', 'translateX(0)');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM