How to use scroll-snap - 2 common examples

To help you get started, we’ve selected a few scroll-snap 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 AugurProject / augur / packages / augur-ui / src / modules / market-charts / components / market-outcome-charts / market-outcome-charts.tsx View on Github external
snapScrollHandler() {
    if (
      this.snapScroller === null &&
      this.charts != null &&
      this.snapConfig != null
    ) {
      this.snapScroller = new ScrollSnap(this.charts, this.snapConfig);
    }

    if (this.snapScroller != null) {
      if (this.props.isMobile) {
        this.snapScroller.bind(this.determineActiveScrolledChart);
        this.determineActiveScrolledChart();
      } else {
        this.snapScroller.unbind();
      }
    }
  }
github AugurProject / augur-ui / src / modules / market / components / market-outcome-charts / market-outcome-charts.jsx View on Github external
snapScrollHandler() {
    if (
      this.snapScroller === null &&
      this.charts != null &&
      this.snapConfig != null
    ) {
      this.snapScroller = new ScrollSnap(this.charts, this.snapConfig)
    }

    if (this.snapScroller != null) {
      if (this.props.isMobile) {
        this.snapScroller.bind(this.determineActiveScrolledChart)
        this.determineActiveScrolledChart()
      } else {
        this.snapScroller.unbind()
      }
    }
  }

scroll-snap

Snap page when user stops scrolling, with a customizable configuration and a consistent cross browser behaviour

MIT
Latest version published 10 months ago

Package Health Score

65 / 100
Full package analysis

Popular scroll-snap functions