我试着用这个
var a ='1200';
var b= '400';
var current_slide = $('.swiper-slide-active');
var current_twenty = current_slide.find('.twentytwenty-wrapper');
var current_twentyCont = current_twenty.find('.twentytwenty-container');
var current_twentyContBefore = current_twentyCont.find('img.twentytwenty-before');
current_twentyContBefore.animate({ clip: "rect(0px,"+a+"px,"+b+"px, 0px)"; }, 1000 );但是它不起作用。我尽量不使用jquery动画fx.step
有没有办法解决这个代码?
发布于 2018-03-08 20:40:01
尝试如下所示
current_twentyContBefore.animate({
fontSize: 100 //some unimportant CSS to animate so we get some values
},
{
step: function(now, fx) { //now is the animated value from initial css value
$(this).css('clip', 'rect(0px, '+now+'px, '+now+'px, 0px)')
}
}, 1https://stackoverflow.com/questions/49172882
复制相似问题