我正在尝试使用jQuery UI拖放将WordPress内容编辑器启用为可拖放。但是,我无法使drag-to-drop或drop事件启动。
我有什么遗漏吗?
<ul id="keywords">
<li>drag one</li>
<li>drag two</li>
<li>drag three</li>
</ul>
jQuery("#keywords").find("li").each(function(){jQuery(this).draggable(
{
helper:\'clone\',
start: function(event, ui){
jQuery(this).fadeTo(\'fast\', 0.5);},
stop: function(event, ui) {
jQuery(this).fadeTo(0, 1);
}
});
});
jQuery(\'#content\').droppable(
{
drop: function(event, ui)
{
alert(\'dropped in content\'); //DOES NOT FIRE!!!
jQuery(this).dropIt(ui.draggable.html());
}
});
if(typeof tinyMCE==\'object\')
{
alert(\'tinyMCE is active\'); //DOES NOT FIRE!!!
jQuery(\'#editorcontainer\').droppable(
{
drop: function(event, ui)
{
alert(\'dropped in tinyMCE editor\'); //DOES NOT FIRE!!!
//Dynamically add content
tinyMCE.activeEditor.execCommand(\'mceInsertContent\', false, \'New content.\');
}
});
}