ForgeKomponenty
sk

Komponenty

j-FloatingBox

jComponent 20 · jcomponent@20 component Príklad načítaný s jComponent 20
  • podporuje tmavý režim

Konfigurácia:

  • zindex {Number} predvolený z-index pre formuláre (predvolené: 10)

Metódy:

  • component.show(opt) zobrazuje rámček
    • opt.id {String} povinné - identifikátor schránky
    • opt.element {HTML Element} povinné - cieľový prvok
      • alebo môžete použiť absolútnu pozíciu:
      • opt.x {Number}
      • opt.y {Number}
    • opt.offsetX {Number} ovplyvňuje posun X
    • opt.offsetY {Number} ovplyvňuje posun Y
    • opt.align {String} zarovnať left (predvolené), center alebo right
    • opt.position {String} zarovnať top (predvolené), bottom
    • opt.minwidth {Number}
    • opt.maxwidth {Number}
    • opt.mouseleave {String} odkaz na metódu, vykoná sa, keď kurzor myši opustí políčko function(e, close)}
    • opt.autofocus {Boolean} sa pokúša zamerať prvú vstupnú/textovú oblasť
    • opt.hide {String} odkaz na metódu function(box_element)
    • opt.show {String} odkaz na metódu function(box_element)
    • opt.autohide {Boolean} umožňuje skryť políčko po kliknutí naň
    • opt.delay {Number} jednoduché oneskorenie vykresľovania (predvolené: 0)
    • opt.scrolltop {Boolean} odpočíta hornú pozíciu rolovania od aktuálneho posunutia Y (predvolené: false)
    • opt.url {String} voliteľné, URL adresa pre obsah
      • opt.path {String} nahradí všetky frázy ~PATH~ v stiahnutej šablóne
      • opt.ID {String} nahradí všetky frázy ~ID~ v stiahnutej šablóne
  • component.hide() skryje poslednú otvorenú schránku
  • component.hide([box_id]) skryje konkrétny box a jeho všetky vnorené boxy
  • component.hide(true) skrýva všetky krabice

Krabice

<div class="floatingbox" data-id="yourid" data-config="">
	Your content
</div>

Konfigurácia:

  • init {String} odkaz na metódu, vykoná sa pri prvej inicializácii boxu function(element)
  • reload {String} odkaz na metódu function(element)
  • hide {String} odkaz na metódu, vykoná sa, keď sa pole skryje function(element)
  • scope {String} vlastný názov rozsahu/doplnku
  • zindex {Number} vlastný z-index pre tento box

Použite ho so <ui-component name="floatingbox">. 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
<ui-component name="exec"></ui-component>
<ui-component name="floatingbox" config="zindex:10"></ui-component>

<!-- Form templates -->

<div class="floatingbox" data-id="1" style="width:200px">
	<div class="padding">
		<div>Box 1</div>
		<br />
		<br />
		<br />
	</div>
</div>

<div class="floatingbox" data-id="2" data-config="init:box2init">
	<div class="padding">
		<div>Box 2</div>
		<br />
		<br />
		<br />
		<span class="exec" data-exec="showbox" data-id="3" style="color:#2A6CEC;cursor:pointer;text-decoration:underline">Show box 3</span>
	</div>
</div>

<div class="floatingbox" data-id="3">
	<div class="padding">
		Box 3
	</div>
</div>

<!-- Executors -->

<div class="row">
	<div class="col-xs-4">
		<span class="exec" data-exec="showbox" data-id="1" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show box 1</span>
	</div>
	<div class="col-xs-4">
		<span class="exec" data-exec="showbox" data-id="2" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show box 2</span>
	</div>
	<div class="col-xs-4">
		<span class="exec" data-exec="showbox" data-id="3" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show box 3</span>
	</div>
</div>

<script>

	function showbox(el) {
		var opt = {};
		opt.element = el;
		opt.id = el.attrd('id');
		SETTER('floatingbox/show', opt);
	}

	function box2init(el) {
		console.log('Box 2 is initialized', el);
	}

</script>