j-Sticker
Configuration:
on {String}this class is enabled when thescroll topposition is greater than this elementYpositionoff {String}this class is enabled when thescroll topposition is smaller than this elementYpositionmargin {Number}a margin which will be deducted from thetopposition of the current elementxs {Boolean}enables sticker for extra small display (default:false)sm {Boolean}enables sticker for small display (default:true)md {Boolean}enables sticker for medium display (default:true)lg {Boolean}enables sticker for large display (default:true)type {String}a method name for obtaining of positionoffset(default) orpositionmarginparent {Number}a margin forparentscrolling (default:0)parent {String}optional, a parent selector (look to example for understanding)- NEW:
minheight {Number}a minimal height of scroll area for applying of classes
Use it with <ui-component name="sticker">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<style>
.fixed { position: fixed; background-color: red; right: 0; top: 0; left: 0; padding: 20px 0; text-align: center; color: white; }
.relative { background-color: blue; padding: 10px; border-radius: 4px; position: relative; display: inline-block; color: white; }
</style>
<div style="padding:50px; height:1500px">
<div style="background-color:#F0F0F0;height:500px;margin:200px 0 0">
<ui-component name="sticker" config="parent:parent" style="position:absolute">
This text will depent on parent position.
</ui-component>
</div>
</div>
<hr />
<div style="padding:50px; height:1500px">
<ui-component name="sticker" config="on:relative;off:fixed">
This text will be on fixed position.
</ui-component>
</div>