How to use the react-scroll.animateScroll.scrollMore function in react-scroll

To help you get started, we’ve selected a few react-scroll examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Datawheel / canon / src / client.jsx View on Github external
function scrollToHash(hash, wait = true) {
  const elem = hash && hash.indexOf("#") === 0 ? document.getElementById(hash.slice(1)) : false;
  if (elem) {
    const offset = elem.getBoundingClientRect().top;
    if (offset) {
      animateScroll.scrollMore(offset);
      setTimeout(() => {
        elem.focus();
      }, 100);
    }
  }
  else if (wait) {
    setTimeout(() => {
      scrollToHash(hash, false);
    }, 100);
  }
}
github fisshy / react-scroll / examples / basic / app.js View on Github external
                <li> <a> animateScroll.scrollMore(500)}&gt;Scroll 500 More!</a></li>
                <li> <a> animateScroll.scrollMore(1000, { delay : 1500 })}&gt;Scroll 1000 More! ( delay ) </a></li>
github fisshy / react-scroll / examples / basic / app.js View on Github external
                <li> <a> animateScroll.scrollMore(1000, { delay : 1500 })}&gt;Scroll 1000 More! ( delay ) </a></li>
                <li>Same target</li>