我使用 angular-js dragula 进行拖放
我需要保存位置,因为用户选择自定义 div 位置。这就是我的 html 的样子
<div class='wrapper'>
<div class='container' dragula='"first-bag"'>
<div>You can move these elements between these two containers</div>
<div>Moving them anywhere else isn't quite possible</div>
<div>There's also the possibility of moving elements around in the same container, changing their position</div>
</div>
</div>
随着$scope.$on
我得到over
和out
事件,但我无法得到id
或类似的获取位置,存储在cookie中。
$scope.$on('first-bag.over', function (e, el) {
el.addClass('over');
console.log(e);
console.log(el);
})
$scope.$on('first-bag.out', function (e, el) {
el.removeClass('over');
console.log(e);
console.log(el);
});
这是 plunker,打开控制台看看会发生什么。请,如果有人知道如何在每个拖放保存 div 订单上,那么下次当用户回来获得保存位置时。谢谢