ForgeKomponenty
sk

Komponenty

j-Sticker

jComponent 20 · jcomponent@20 component Príklad načítaný s jComponent 20

Konfigurácia:

  • on {String} táto trieda je povolená, keď je poloha scroll top väčšia ako poloha tohto prvku Y
  • off {String} táto trieda je povolená, keď je poloha scroll top menšia ako poloha tohto prvku Y
  • margin {Number} marža, ktorá bude odpočítaná z pozície top aktuálneho prvku
  • xs {Boolean} umožňuje nálepku pre extra malý displej (predvolené: false)
  • sm {Boolean} umožňuje nálepku pre malý displej (predvolené: true)
  • md {Boolean} umožňuje nálepku pre stredné zobrazenie (predvolené: true)
  • lg {Boolean} umožňuje nálepku pre veľký displej (predvolené: true)
  • type {String} názov metódy na získanie pozície offset (predvolené) alebo position
  • marginparent {Number} okraj pre rolovanie parent (predvolené: 0)
  • parent {String} voliteľné, rodičovský volič (pre pochopenie si pozrite príklad)
  • NOVINKA: minheight {Number} minimálna výška rolovacej oblasti pre aplikáciu tried

Použite ho so <ui-component name="sticker">. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v DEF.fallback (predvolene CDN Componentator). Autor: Peter Širka. Zdroj: úložisko komponentov Componentator, licencia MIT.

example.html
<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>