user1547359
user1547359

Reputation: 33

jquery global animation duration

I have a page with many jQuery animations, each has it's own duration defined individually.

I want to disable all the animations on mobile devices by setting the duration to 0.

Is there a way to overwrite all the animation durations globally?

something like this:

    if (isMobile()) {
$.animation.duration.disable = true;
}

Upvotes: 2

Views: 135

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 263009

You can set jQuery.fx.off to true:

if (isMobile()) {
    $.fx.off = true;
}

Upvotes: 5

Related Questions