Jquery在Firefox中拖放不起,在chrome和safari中工作正常 [英] Jquery Drag and drop not working in Firefox, works fine in chrome and safari
本文介绍了Jquery在Firefox中拖放不起,在chrome和safari中工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码:
Jquery拖放在Firefox和IE中不起作用,但在chrome和safari中可以正常工作。
This is my code:
$(".drag").draggable({
helper: "clone",
});
$(".drop").droppable({
drop: function (ev, ui) {
if ($(ev.toElement).hasClass("drop") == true) {
var widgetId = $(ui.draggable).attr("id");
$(ev.toElement).attr("id", "dash_" + widgetId);
$(ev.toElement).html($(ui.draggable).html());
}
}
});
上传的代码 http://www.skmcap63.hostoi.com/box-dashboard/
我需要拖动从侧栏的项目,并将其放入盒子。
请帮忙。
提前感谢。
I need to drag the items from sidebar and drop it into boxes. Please help. Thanks in advance.
推荐答案
尝试这样可以为您工作
$(".drop").droppable({
drop: function (ev, ui) {
if ($(ev.target).hasClass("drop") == true) {
var widgetId = $(ui.draggable).attr("id");
$(ev.target).attr("id", "dash_" + widgetId);
$(ev.target).html($(ui.draggable).html());
}
}
});
这篇关于Jquery在Firefox中拖放不起,在chrome和safari中工作正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文