Sticky

Stick to container; 50px offset
Sticky after 50vh; Scroll up if initially above paragraph below
Stick below container; animation
Stick until next paragraph
Sticky on scroll up; animation
Sticky after 300px scrolling; @media 640px

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Sticky bottom

Oversized Content

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

JavaScript Options

Option Value Default Description
position `top`|`bottom`|`auto` `top` The position the element should be stuck to. With position `auto` the element sticks to the top of the viewport if it's smaller than the viewport, otherwise it sticks to the top.
top Number|Viewport Height|CSS Selector 0 The top offset from where the element should stick.
bottom Boolean|CSS Selector false The bottom offset until the element should stick. (true: parent element, prefixed with '!' a parent selector)
offset String 0 The offset the Sticky should be fixed to. It supports basic mathematics operands + and -. (e.g. 50vh + 50%)
animation String false The animation to use.
cls-active String uk-active The active class.
cls-inactive String '' The inactive class.
sel-target CSS Selector self The target element to apply active and inactive classes to. Defaults to the element itself.
show-on-up Boolean false Only show sticky element when scrolling up.
media Number|String false Condition for the active status - a width as integer (e.g. 640) or a breakpoint (e.g. @s, @m, @l, @xl).
target-offset Boolean, Number false Initially make sure that the Sticky is not over a targeted element via location hash.