On Sep 21, 2009, at 9:02 am, Jorge Chamorro wrote: > On 21/09/2009, at 17:44, David Kaneda wrote: > >> FWIW: You'll want to use -webkit-transform: translate() — or even >> translate3d() — instead of left. It'll come out smoother- >> >> Best, >> >> Dave > > I saw Sean is using translateX(%) in iui.js., I'll give it a try. > Thanks ! > > But, btw, any guess about why is it smoother than "left" ?
Because we did an enormous amount of work inside WebKit to be able to map certain animations to the underlying compositing engine, which means they are hardware-accelerated. We could do that for "-webkit-transform", but not "left". Here's the recommendation for what kinds of transforms to use: If you using -webkit-transition with -webkit-transform, then go ahead and use whatever transform makes the most sense (e.g. translateX(), scale(), rotate() etc). If a transition or animation on -webkit-transform is running, that gets hardware accelerated. If you're changing -webkit-transition "by hand" from JavaScript and want to achieve good performance (e.g. maybe you're responding to touch events from the user, moving things around), then use one of the 3d transform types: translate3d(), rotate3d() etc. Those will be faster in this case. Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---
