English 中文(简体)
页: 1
原标题:Editing draggable after it s added to a sortable

Hey, I m试图研究我需要做哪些活动,以及我需要用什么财产来查阅投放项目的多功能元素(That是接收名单上的项目)。

这里指的是我迄今为止所做的事情。

<ul id="toolbox">
    <li>A</li>
    <li>B</li>
    <li>C</li>
</ul>
<ul id="existing">
</ul>
<script language="javascript">
    $( #existing ).sortable({
        revert: true
    });
    $( #toolbox li ).draggable({
        connectToSortable:  #existing ,
        helper:  clone ,
        revert:  invalid ,
    });
</script>

比如,我的目标是,一旦把A变成了第一种现有案文(否则就足够了——实际执行更为复杂)。 我只需要把我的手掌握在人力部。

我曾尝试过以下几点,作为我的接待:

function receive(ev, ui)
{
    $(this).append( <b>this</b> );
    ui.sender.append( <b>sender</b> );
    ui.item.append( <b>item</b> );
}

但是,这似乎只是现有的UL、发送器和物件都是被拖入工具箱的利弊。 我所期待的是新创建的浮游动物。 是否有财产或另一事件会给我什么东西?

最佳回答

我最近也有同样的问题。 我以如下方式解决这个问题:

$( #existing ).droppable({
    drop: function(e, ui) {
        // ui.draggable is the node that gets created in #existing
        // ui.draggable[0].originDragger is the node that was 
        // dragged from #toolbox
    }
}).sortable({
    revert: true
});
问题回答

我曾经尝试过其中任何一个,但在理论上,他们似乎喜欢工作。 第一,如果您提出<代码>,即现有。 http://jqueryui.com/demos/droppable/“rel=“nofollow noreferer”>droppable, 您可在drop上做一些事情。 活动,如从电离层中获取你所需要的信息,如<条码>(<>text(>),从电离层流中删除该物体,并产生新的内容。

否则,你可以在<条码>上做一些事情。 贵重情况,如检查父母是否现为<条码>,即现有。 希望这一帮助。

不受<条码>的约束,而是受<条码>约束。 like

$("#sortable").bind( sortout , function(event, ui) {
 console.log(ui.item);
});

<>>>>

$("#sortable").sortable({ //during initialization
  out:function(event, ui) {
     console.log(ui.item);
   }
 });

此处<代码>ui.item 这将是你所期望的内容。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签