我正在尝试使用辅助功能更改要拖动的项目的元素,我有以下示例(不起作用):jsfiddle
以下代码似乎有效:
$('#original').draggable();
$('#clone').draggable({helper: 'clone' });
但是,如果我将“克隆”更改为以下内容:
$('#clone').draggable({helper: function(e,ui) { return $(ui).clone().html("<p>clone</p>"); }});
它有问题。
任何帮助,将不胜感激。谢谢
尝试:http : //jsfiddle.net/lotusgodkk/Uxfnc/1/
更新:
$('#original').draggable();
$('#clone').draggable({
helper: function (e, ui) {
return $(this).clone(true).html("<p>clone</p>"); //Replaced $(ui) with $(this)
}
});
希望能帮助到你。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句