Jquery animate & # 8594; css -webkit-transform: translate3d

I have an iPhone and Phonegap and JQtouch app.

Now I use:

$('someElement').animate(...); 

to switch screens.

The problem is that the performances are pretty bad.

I read that there is a much better way to do this with "css -webkit-transform: translate3d",

I need to create a simple jQuery function that gets the "div" of a new screen and then moves it from right to left in 350 ms. When the animation is complete, I also need to run some other jQuery function.

+8
iphone cordova
source share
1 answer

CSS

 #layer{ -webkit-transition-duration: 350ms; -webkit-transform: translate3d(0,600px,0); position: absolute; } 

JQuery

 $('#layer').css('-webkit-transform', 'translate3d(0,0,0)'); 
+6
source share

All Articles