我需要了解哪个块正在移动并冲向另一个块。我怎么知道.one(或.two)块是否会降为.three块?
飞镖
import 'dart:async';
import 'dart:html';
main() {
var one = document.querySelector('.one');
one.onDragStart.listen(_onDragStart);
one.onDragEnter.listen(_onDragStop);
var two = document.querySelector('.two');
one.onDragStart.listen(_onDragStart);
one.onDragEnter.listen(_onDragStop);
}
_onDragStop(MouseEvent event) {
print('stop');
}
_onDragStart(MouseEvent event) {
print('start');
}
html
<div class="one" draggable="true"></div>
<div class="two" draggable="true"></div>
<br><br><br>
<div class="three"></div>
css
.one{
background: green;
width: 50px;
height: 50px;
}
.two{
background: green;
width: 50px;
height: 50px;
}
.three{
background: red;
width: 250px;
height: 250px;
}
我刚刚开始学习这种语言。我请社区的帮助。