Closed frontend-stunntech closed 4 years ago
hi, i am using dragula in jquery to drag and drop some widgets and container but i need to drag only in one direction mean in y-axis(up and down only). how can i do this?
$(document).ready(function () { dragula([document.querySelector('.containers')], { direction: function(el, target, source, sibling) { //logic here return 'horizontal'; }, moves: function (el, source, handle, sibling) { console.log(handle) if (handle.classList.contains('task-header')) { return true; } return false; $('.task-header').draggable({ axis: "y" });
}
hi, i am using dragula in jquery to drag and drop some widgets and container but i need to drag only in one direction mean in y-axis(up and down only). how can i do this?
$(document).ready(function () { dragula([document.querySelector('.containers')], { direction: function(el, target, source, sibling) { //logic here return 'horizontal'; }, moves: function (el, source, handle, sibling) { console.log(handle) if (handle.classList.contains('task-header')) { return true; } return false; $('.task-header').draggable({ axis: "y" });