Coder Social home page Coder Social logo

scroll-to's Introduction

scroll-to

Smooth window scroll to position with requestAnimationFrame and Tween.

Installation

$ component install component/scroll-to

API

scrollTo(x, y, [options])

Scroll to the given point (x, y) with the given options:

  • ease easing function defaulting to "out-circ" (view ease for more)
  • duration animation duration defaulting to 1000
var scrollTo = require('scroll-to');

scrollTo(500, 1200, {
  ease: 'out-bounce',
  duration: 1500
});

License

MIT

scroll-to's People

Contributors

dy avatar forbeslindesay avatar sergioramos avatar tj avatar tootallnate avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scroll-to's Issues

TypeError: Invalid calling object at animate in IE

I get this error as a part of https://github.com/flyingant/react-scroll-to-component which uses scroll-to

TypeError: Invalid calling object at animate (eval code:46:5) at scrollTo (eval code:50:3) at module.exports (eval code:31:3) at Anonymous function (eval code:136:11) at callCallback (eval code:16433:152) at commitUpdateEffects (eval code:16472:29) at commitUpdateQueue (eval code:16460:19) at commitLifeCycles (eval code:17365:3) at commitAllLifeCycles (eval code:18736:44) at callCallback (eval code:150:1)

Update npm package?

The current npm package breaks in browserify because it's missing the browser field in package.json

Cannot find module 'tween' when requiring scroll-to server side

I'm using scroll-to-element in a React app that pre-renders on the server. When requiring scroll-to-element, which is dependent on scroll-to, I get Error: Cannot find module 'tween'.

I believe this is because scroll-to requires component-tween via var Tween = require('tween'); which works in browser environments because of the following in package.json.

  "browser": {
    "raf": "component-raf",
    "tween": "component-tween"
  },

everything works fine in the client, but the application errors out when running on the server because node doesn't know what tween is.

Module build failed: Error: Cannot find module 'tween'

I am using react-scroll-to-component, which relies upon scroll-to. When I try to build, it cannot find 'tween', so I rename to 'component-tween', but then on and on with other errors in other dependencies installed along with scroll-to. But if I comment out my use of react-scroll-to-component, webpack can build. Then I un-comment and it is fine and everything works. Any idea what I can do, as this seems like less than ideal?

support for custom scroll container

Is there any plans of adding custom scroll container instead of scrolling window only?

I can PR if you think its a feature that can go in.

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.