Giter Site home page Giter Site logo

velocity's People

Contributors

amazeplc avatar cfenzo avatar danro avatar donnielrt avatar hiswe avatar jdorfman avatar jeffmicklos avatar jperl avatar julianshapiro avatar kennethormandy avatar kpeatt avatar loopj avatar nikola avatar nmussy avatar scalvert avatar tedtate avatar tombyrer avatar ydaniv avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kazimolmez

velocity's Issues

'container' option causes animation to fail, when using Zepto object as value

CC @tedtate @donnielrt

Background

  • When performing a scroll animation, Velocity will allow you to scroll an element into view of a containing element, rather than window --- this is done by providing a container option
  • Take a look at the following example usage:
$.fn.velocity($('.element'), 'scroll', {
        'container': $('.container')
});
  • Unfortunately, using $('.element') (a Zepto object) as the value for 'container' will result in the animation function executing, but failing silently (i.e. no animation occurs but no error is thrown either). Providing a raw DOM node (e.g. $('.container')[0]) or a desktop jQuery selection instead will work correctly.

Problem

isWrapped: function (variable) {
    return variable && (variable.jquery || (window.Zepto && window.Zepto.zepto.isZ(variable)));
},
  • The check for window.Zepto && window.Zepto.zepto.isZ(variable) will fail due to the way we include Zepto as our selector library in adaptive.js projects. window.Zepto.zepto.isZ will always return false
  • For posterity, here's the related code in zepto.js:
zepto.Z = function(dom, selector) {
    dom = dom || []
    dom.__proto__ = $.fn
    dom.selector = selector || ''
    return dom
}

zepto.isZ = function(object) {
    return object instanceof zepto.Z
}

Notes

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.