- $(document).mousemove(function(e) {
- if (!!this.move) {
- var posix = !document.move_target ? {'x': 0, 'y': 0} : document.move_target.posix,
- callback = document.call_down || function() {
- $(this.move_target).CSS({
- 'top': e.pageY - posix.y,
- 'left': e.pageX - posix.x
- });
- };
- callback.call(this, e, posix);
- }
- }).mouseup(function(e) {
- if (!!this.move) {
- var callback = document.call_up || function(){};
- callback.call(this, e);
- $.extend(this, {
- 'move': false,
- 'move_target': null,
- 'call_down': false,
- 'call_up': false
- });
- }
- });
- //该片段来自于http://www.codesnippet.cn/detail/2110201410740.html
来源: http://www.codesnippet.cn/detail/2110201410740.html