MSection (.MSECTION)
A section element that toggles data-m-visible attribute when it's visible on the screen.
Preview
(scroll slowly in the section to see the effect)
Attributes
Name | type | optional | description |
---|---|---|---|
forward | boolean | true | to make visibility ratio go up only and not going down |
Usage
Use the data-m-visible attribute or the --m-visibility-ratio css variable to know if the section is within the screen borders and determine how much of it is on the screen. You can use that to perform an action or add an animation on scroll.