Giter Club home page Giter Club logo

Comments (6)

benbarnett avatar benbarnett commented on July 18, 2024

Unless I'm misunderstanding, this has existed since the original release:

avoidTransforms: (Boolean)
By default the plugin will convert left and top animations to the CSS3 style -webkit-transform (or equivalent) to aid hardware acceleration. This functionality can be disabled by setting this to true.

Using the above property will simply bypass the plugin and pass it back to the default jquery animate method.

from jquery-animate-enhanced.

afaenger avatar afaenger commented on July 18, 2024

I thought that using "avoidTransforms" is only relevant for the position and size transistion; in this case it will not animate the "transform" property but "left", "top","width" or "height" instead. What I need is to turn off all transition for certain animate invocations, e.g. for changing the opacity.

from jquery-animate-enhanced.

benbarnett avatar benbarnett commented on July 18, 2024

Ah I see, yes you're right that setting only affects position/size animations.

Ok this shouldn't be a big deal to add in. Literally just a property that will bypass the entire plugin. 'avoidCSSTransitions' works for me.

I'll keep you posted.

from jquery-animate-enhanced.

afaenger avatar afaenger commented on July 18, 2024

Just a thought: in my projects I have a lot of jquery plugins that also use animate(). I'm looking for a way to configure from outside whether they should use css transistions or the normal jquery.animate() so that I don't have to adapt all the scripts.
I'm thinking of a kind of live selector that may be passed to jquery-animate-enhanced to turn off the enhancement, e.g.
jQuery.fn.animate.defaults.avoidCSSTransitions=$(".no-transition")
so I could easily configure the behaviour within the HTML/CSS file by just adding the class. One could also have a "white" list selector in case only specific nodes' animation should be enhanced, and all others should just revert to the default animate call. This kind of control over the usage of css transitions would be really cool as the page designer would just have to set the classes for the affected nodes.

from jquery-animate-enhanced.

licx avatar licx commented on July 18, 2024

Any news on this new "avoidCSSTransitions" property?

from jquery-animate-enhanced.

benbarnett avatar benbarnett commented on July 18, 2024

Just been added, sorry for the delay on this!

Simply set to true:

$('.target').animate({left: "-=200px", avoidCSSTransitions:false}, 1000);

from jquery-animate-enhanced.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.