scroll-animator | 100 lines of code ) and dependency-free library | Animation library
kandi X-RAY | scroll-animator Summary
kandi X-RAY | scroll-animator Summary
A lightweight ( ~ 100 lines of code) and dependency-free library to animate elements on your page as you scroll written in pure Javascript.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of scroll-animator
scroll-animator Key Features
scroll-animator Examples and Code Snippets
Community Discussions
Trending Discussions on scroll-animator
QUESTION
I'm having some trouble figuring out how best to get this animation to work.
I have two elements that are centered vertically inside of a flexbox layout, I want to get these elements to animate into their final positions by sliding in from off-screen, however, this seems to be giving me some unexpected results I assume because of their flex positioning. Any thoughts on how I can tackle this?
Here is a plunker showing the current state of things, I've slowed the animation down so you can see the dilemma and where I'm trying to take this.
...ANSWER
Answered 2017-Oct-09 at 17:52When using percent with translate
, it is the elements own size it refers to, which means, if an element is 200px high, translateY(100%)
will move it 200px (100% of its own height) down.
In this case you can use viewport units instead, i.e. transform: translateY(100vh);
, which means it will position the element at the bottom of the viewport, no matter its height.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scroll-animator
window.requestAnimationFrame
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page