j-Movable
Komponenta zachází s podobným prvkem draggable a podporuje pohyb mezi sebou.Každý prvek podle selektoru musí mít definovaný atribut draggable="true".
Konfigurace:
selector {String}jQuery selektor pro sledováníexec {String}- cesta k metodu, která bude spuštěna v případě, že uživatel pohybuje prvek- Výsledky dráhy a pádu
global {Boolean}budou připojeny kdocument(předvolené:false) parent {String}selektor pro nalezení prvku, ve kterém budou připojeny drážky a pásky (default: aktuální prvek)move {Boolean}umožňuje automatické přepisování prvků (podmínkou:true)container {String}- výběr hlavního kontejneru- NEW
check {Function(el)}volitelné, funkce pro ověření dráždivosti (musí se vrátittruenebofalse)
Příklad metody Exec:
function exec_method(list, dragged, target) {
// @list jQuery list
}Dobré vědět:
pathse provádíCHANGE()
Použijte ji s <ui-component name="movable">Pokud je součástka ještě nezačleněna, jComponent Stáhnout ji na první použití z adresy DEF.fallback a) The Componentator CDN dle předvolby. autor: Peter Širka. zdroj: Componentator Výrobce je autorizován, MIT licence.
<ui-component name="movable" config="selector:.dragme;exec:moved">
<div class="dragme" draggable="true" style="width:50px;line-height:50px;background-color:#F0F0F0;text-align:center;position:relative;display:inline-block;margin:10px">A</div>
<div class="dragme" draggable="true" style="width:50px;line-height:50px;background-color:#E0E0E0;text-align:center;position:relative;display:inline-block;margin:10px">B</div>
<div class="dragme" draggable="true" style="width:50px;line-height:50px;background-color:#D0D0D0;text-align:center;position:relative;display:inline-block;margin:10px">C</div>
<div class="dragme" draggable="true" style="width:50px;line-height:50px;background-color:#C0C0C0;text-align:center;position:relative;display:inline-block;margin:10px">D</div>
<div class="dragme" draggable="true" style="width:50px;line-height:50px;background-color:#B0B0B0;text-align:center;position:relative;display:inline-block;margin:10px">E</div>
<div class="dragme" draggable="true" style="width:50px;line-height:50px;background-color:#A0A0A0;text-align:center;position:relative;display:inline-block;margin:10px">F</div>
</ui-component>
<script>
function moved(list) {
console.log(list);
}
</script>