Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Disabling All Effects

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 106
    Comment on it

    Your user or web application may require that all animations are disabled, but the effect of revealing information or scrolling (or whichever animation type) may still be required. jQuery has a way to disable all animations from one access point but still supports the animate method and its final value.

    $.fx.off = true; 
    $(document).ready(function () { 
       $('#animate').click(function () { 
         $('.box').animate({ width: '+=100', height: '+=100' }); 
         }); 
       }); 
    

    By setting fx to off using the following line, all animation calls have the same effect as calling css() directly:

    $.fx.off = true; 
    

    This can be set at any point and it will disable the animations, which means it can be offered as a user preference. To enable animations again

    $.fx.off = false;
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: