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)

This section is visible
This section is visible

Attributes

Nametypeoptionaldescription
forwardbooleantrueto 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.