GithubHelp home page GithubHelp logo

Comments (6)

oak-tree avatar oak-tree commented on June 9, 2024

What do you think on something like ?

Option1

 snbbat(elements,{
            position : [ -(this.$el.width() + INT_GAP), 0, 0 ],
            easing : 'easeIn,
            duration : 450,
            }).({clearStyles:true})

Options2

 snabbt(elements,{
            position : [ -(this.$el.width() + INT_GAP), 0, 0 ],
            easing : 'easeIn,
            duration : 450,
            callback: function(){snabbt(elements,{clearStyles:true}))
            })

from snabbt.js.

tommiehansen avatar tommiehansen commented on June 9, 2024

@oak-tree What's wrong with element.removeAttribute('style')?

Create a shorthand or something:

// remove from single selector
function clearStyle(e){
    e.removeAttribute('style');
}

// remove from multiple selectors
function multiClearStyles(e){
    var i = 0, len = e.length;
    for(i;i<len;i++){ e.removeAttribute('style'); }
}

...and just call clearStyle(element) on complete.

Would need a fix for jQuery like e[0] etc to get the raw element if using jQ.

from snabbt.js.

oak-tree avatar oak-tree commented on June 9, 2024

well. because some elements can have some presnabbit styles. so maybe one wants to reset only snabbt styles

from snabbt.js.

tommiehansen avatar tommiehansen commented on June 9, 2024

@oak-tree As i said one could write a more complex func and add stuff like: elem.style.removeProperty('some-style-property');.

You shouldn't have inline styles on your elements to begin with though so you should just remove the style all together.

from snabbt.js.

daniel-lundin avatar daniel-lundin commented on June 9, 2024

Since removing the styles is just a one-liner I don't see the need to wrap it within snabbt.

from snabbt.js.

oak-tree avatar oak-tree commented on June 9, 2024

just think on the case where other plugins add some property to the element. one may want to cancel only snabbt properties.

from snabbt.js.

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.