Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I speed up a page transition animation?

I have made a simple application for my iphone using jQuery Mobile and Phonegap. it works very well, but the application used the following to transition to another page and that was slow as hell:

<a data-role="button" id="about_link" data-transition="slide" 
     href="#page3" data-icon="gear" data-iconpos="left">
     Settings
</a>

Just a simple a is doing the magic here and that resulted in the weird 400ms lag etc...

Now after a lot of reading I made the a button a div and handled the click event myself to make the button faster.

$("#about_link").live("touchstart", function(){
    slideTo('#page3',false);
});
function slideTo(page,reverse){
    $.mobile.changePage( page, {
        transition: "slide",
        reverse: reverse
    } );
}

The difference is significant, but it's still too slow for my taste. It looks like jQuery Mobile waits for the entire button animation (hover and clicked) to finish before it goes over to the other page.

Now my questions:

  1. Is touchstart the fastest way? I used other libraries like fastclick but that wasnt super fast either.
  2. Is the button animation the badguy here? Can I disable it then?
  3. Can you guys give me tips? Google isnt my friend on this particular problem...

Gr.

like image 982
Hans Wassink Avatar asked Apr 11 '12 13:04

Hans Wassink


People also ask

How can I make my slides transition faster?

Set the speed of a transition Select the slide that has the transition that you want to change. On the TRANSITIONS tab, in the Timing group, in the Duration box, type the number of seconds that you want it to run. If you want all the slide show's transition effects to use the same speed, click Apply To All.

How do I speed up Windows animation?

Press Windows + R to open a new Run box and type regedit inside it. Press Enter afterward. Double click on the MenuShowDelay option and change the Value data option to any choice between 0 and 4000. To speed up the animations, input a small value that ranges from 0 to 150.

How do I change the animation speed on my Samsung?

Now go to System. Tap on Developer options. Scroll all the way down until you reach the Screen Display category. Set the value of Window animation scale, Transition animation scale, and Animation duration scale to 0.5 or 0 respectively.


1 Answers

It's actually in jquery mobile's css:

.in, .out {
    -webkit-animation-timing-function: ease-in-out;
    -webkit-animation-duration: 350ms !important;
}

Just tweak the ms and you're good.

like image 105
steve Avatar answered Oct 27 '22 10:10

steve