back

Sticky elements

Make elements stick inside their parent boundary on scroll.

Usage

<div class="my-parent">
  <div 
    class="my-element"
    data-lg-sticky>
    My element...
  </div>
</div>

Attributes

Attribute Type Default Description
data-lg-sticky String null By default the element will be vertically centered in the viewport during scroll. You can set the attribute to top or bottom if you want the element to stick to the viewport top ro bottom limit.