Skip to content
CSS scroll Snap Points Polyfill
Branch: master
Clone or download
Sergi Meseguer Sergi Meseguer
Sergi Meseguer and Sergi Meseguer updated demo
Latest commit 0fe79b8 Nov 23, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
imgs initial draft, v.0.1.0 Jul 25, 2015
.editorconfig initial draft, v.0.1.0 Jul 25, 2015
css-scroll-snap-points-polyfill.js
css-scroll-snap-points.css fix Firefox bug with scroll-snap-points-y 100% Jul 27, 2015
index.html initial draft, v.0.1.0 Jul 25, 2015
readme.md updated demo Nov 23, 2015

readme.md

scroll Snap Points Polyfill

===========================

Tiny Javascript Pollyfill to simulate CSS scroll Snap Points in non-supporting browsers.

Setup

  1. Include the script at the end of your HTML, it will autorun when DOM is ready.
  2. Enjoy.

Options

Run after DOM injection

You can also run the script manually. Usefull when you dynamically inject nodes into your document.

// your DOM injecton here
// then:
znapscroll.prepare();

Destroy after DOM removal

Since you might want to remove elements from the DOM, we need to make sure memory is not leaked.

// your DOM removal here
// then:
znapscroll.destroy();

Destroy limiting by context

destroy method accepts a context argument, to limit destruction to an HTML element:

// your DOM removal here
// then (limited to children of element with id=g1):
znapscroll.destroy( document.getElementById('g1') );

Demo

See full working demo

You can’t perform that action at this time.