Hello,
I'm trying to create a page with sections moving in parallax. Each section will have an image. Some of these images will scroll normally, while for some I'd like a different movement, like scrolling slowly in the opposite direction. Basically I'd like to recreate the effect in this page: https://www.squarespace.com/websites/templates/mercer (you have to click on "PREVIEW MERCER" to see it).
I set up a pen with three sections: the first and the last one should move normally, while th
Great stuff, Blake.
Just in case people need a little more info on how normalize() and clamp() work here is a reduced demo with some comments
// normalize will return a value between 0 and 1
function normalize(value, min, max) {
return (value - min) / (max - min);
}
// 40 is half-way between 30 and 50
// value, min, max
console.log(normalize(40, 30, 50)); // return 0.5
//clamp forces a value into a range
function clamp(value, min, max) {
return value < min ? min : (value &