【发布时间】:2012-07-19 04:30:39
【问题描述】:
玩拖放,虽然我似乎可以很好地拖动,但我似乎无法放下。
这是我的游乐场: http://jsfiddle.net/KZ8RD/1/
基本上,可拖动节点上的dragstart 和dragend 事件似乎可以正常触发。但我还没有触发该目标节点上的任何事件。
# Source handlers
$('#source')
.on('dragstart', (e) -> log '#source dragstart', this, e)
.on('dragend', (e) -> log '#source dragend', this, e)
# Target Handlers
$('#cells td')
.on('dragenter', (e) -> log 'target dragenter', this, e)
.on('dragleave', (e) -> log 'target dragleave', this, e)
.on('dragover', (e) -> log 'target dragover', this, e)
.on('drop', (e) -> log 'target drop', this, e)
那么要触发目标的dragenter 和drop 事件需要存在哪些条件?我显然错过了其中的一些。
【问题讨论】:
标签: javascript jquery html drag-and-drop coffeescript