我正在开发一个应用程序,但在实现 jQuery 拖放时遇到问题。请看一下代码。
我正在开发的是使用 css Clip Path 的多边形形状。当我拖动 Swipe Me Circle 并放在红色上时,它会返回“Dropped on Red”的警报,但它也会返回“Dropped on Blue”的警报,而 Circle 会掉在红色上。
我会感谢你的帮助。
我的 jQuery 代码是:
$(function() {
$( "#draggable" ).draggable();
$( "#RedTriangle" ).droppable({
drop: function( event, ui ) {
alert("Dropped On Red");
}
});
$( "#GreenTriangle" ).droppable({
drop: function( event, ui ) {
alert("Dropped On Green");
}
});
$( "#BlueTriangle" ).droppable({
drop: function( event, ui ) {
alert("Dropped On Blue");
}
});
});