Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skrollr: how to start animation only once a certain point is reached?

I'm playing with skrollr plugin but can't achieve what I want so looking for assistance. I've been able to implement easy effects such as <div id="intro-left" data-0="opacity: 0" data-180="opacity: 1"> (means that my DIV called intro-left becomes visible once user scrolls down by 180)

The issue is that I don't like to use the scrolling distance since this would only makes sense if everone had the same screen resolution right?

What I'd like to do is to tell skrollr: "Change DIV from opacity 0 to opacity 1 once the DIV position becomes visible on the screen" (in other words "Change DIV from opacity 0 to opacity 1 once user reaches a certain point on the page by scrolling down)

Is this achievable with skrollr, and how?

Many thanks

like image 276
Greg Avatar asked Mar 22 '23 12:03

Greg


1 Answers

Did you look at the documentation?

There's even an example demonstrating different anchors

In short:

<div id="intro-left" data-bottom-top="opacity: 0" data-center="opacity: 1">
like image 180
Prinzhorn Avatar answered Apr 07 '23 14:04

Prinzhorn