Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Commit

Permalink
improve solution for drag on bootstrap modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Barrior committed Nov 8, 2017
1 parent 2e6e0c4 commit 26ec1e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demo_bootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
// 由于 transform 的影响,对于类似 bootstrap 这样用了 transform 的元素,
// 需要手动处理拖拽元素的位置,如下
move: function (left, top) {
$(this).css('left', left - $('.modal-dialog').offset().left)
$(this).css('left', left - $('.modal-dialog').offset().left);
$(this).css('top', top - $('.modal-dialog').offset().top);
}
});
</script>
Expand Down

0 comments on commit 26ec1e8

Please sign in to comment.