stutrek / scrollmonitor-parallax Goto Github PK
View Code? Open in Web Editor NEWA simple parallax API
A simple parallax API
heya, does (or should) this use requestAnimationFrame? the demo example is quite janky in chrome even. cheers!
It could be useful to pass an existing scrollMonitor container, rather than always using the default
constructor. I'm looking at removing existing scroll event listeners when rebuilding the DOM from scratch (as with something like Turbolinks), but it seems like it would also allow the use of this library if the window is not the scroll container.
I can make a PR, but I wanted to check if there was a particular approach you would prefer.
Hello,
I installed both scripts scrollmonitor
and scrollmonitor-parallax
with npm.
I get this error :
0:0 error Module build failed: Error: Couldn't find preset "react" relative to
directory
"/Users/sylvainprevost/Sites/wp-starter/front/node_modules/scrollmonitor-parallax"
โ 1 problem (1 error, 0 warnings)
webpack: Failed to compile.
I tried this :
import scrollMonitor from 'scrollmonitor';
import Parallax from 'scrollmonitor-parallax';
and
import scrollMonitor from 'scrollmonitor/scrollMonitor.js';
import Parallax from 'scrollmonitor-parallax/Components.js';
None of these works. ScrollMonitor works fine, but Parallax extention not :(
Hey man, awesome piece of code! I found a typo on line 73 it says "wathcer" instead of "watcher".
Shouldn't passive support be added to the scroll
addEventListener?
var browserSupportsPassive = false;
if (isInBrowser) {
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
browserSupportsPassive = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {}
}
const useCapture = browserSupportsPassive ? {capture: false, passive: true} : false;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.