j-Movable
Komponenten hanterar liknande draggable-element och stöder rörelse mellan varandra. Varje element enligt selektorn måste ha definierad draggable="true" attribut.
Konfigurera:
selector {String}jQuery för att seexec {String}En väg till metoden som kommer att utföras om användaren flyttar elementetglobal {Boolean}drag & drop händelser kommer att kopplas tilldocument(default:false)parent {String}-selektor för att hitta elementet där drag & drop-vetsar kommer att bindas (default: aktuell element)move {Boolean}möjliggör automatisk ombeställning (default:true)container {String}en selektor för att hitta huvudkontakten- NEW
check {Function(el)}valfritt, en funktion för att kontrollera dragbarhet (det måste returneratrueellerfalse)
Exempel på Exec:
function exec_method(list, dragged, target) {
// @list jQuery list
}Bra att veta:
pathutförCHANGE()
Använd den med <ui-component name="movable">När komponenten ännu inte är laddad, jComponent Ladda ner den första gången från adressen i DEF.fallback (en av Componentator Författare: Peter Širka. källa: The Componentator Komponenterna i lager, MIT licens.
<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>