1. 程式人生 > >jq div 滾動到指定位置,jq不支援animate實現css3的transform動畫效果

jq div 滾動到指定位置,jq不支援animate實現css3的transform動畫效果

 //第一個花括號裡面是動畫內容,可以為空,但不能省去中括號

$("#div").animate({},function(){                                      

    $("#div").css({

        'transform':'translate3d(0px, -200px, 0px) translateZ(0px)', //向下滑動-200px

        'transition-duration': '500ms' //實現動畫過渡時間

    });                                   

})