English 中文(简体)
Destroying jQuery Sortable/Droppable
原标题:Destroying jQuery Sortable/Droppable

因此,我有一个问题,那就是,在用户发出一个 but子时,我能够辩论可以想象的 behavior行为。 IE具有某种模式和观点。 我试图这样做:

function enterEdit(){
    $( #someDiv ).sortable();
} 

function enterView() {
    $( #someDiv ).sortable( destroy );
}

$( #editToggle ).on( click ,  .toggle-button , function(e){
        var $target = $(e.target);
        if(!$target.hasClass( active )) {
            if($target[0].id ==  edit ){
                enterEdit();                    
            } else {
                enterView();
            }
            $( #editToggle ).children().removeClass( active );
            $target.addClass( active );
        }
    });

这就是正在做的事情。 它首先投入运作,然后理论也发挥作用。 问题在于,当我再次点燃时,无法重新开始。 是否有任何人事先尝试过,或找到更好的解决办法? 感谢!

最佳回答

如果你给每个部分,每个部分应分一个特定类别,然后用<条码>(#someDiv) 美元(参数: li.yourClass});开始。

然后,你可以点击来补充和删除这一类别,这些要素将被排除或再次列入。

问题回答

你有正确的想法,但我感到不解的是,为什么对“活跃”进行双重检查,然后是“id”。 你们也应当使用(这是)美元,而不是所有目标。

查阅。 它为你所做的工作做了总结,我认为它确实是你想要的。





相关问题
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.

热门标签