2014-01-08 42 views
0

我在我的asp.net应用程序中使用此示例(http://webdeveloperplus.com/jquery/saving-state-for-collapsible-drag-drop-panels/)。我在Firefox以外的所有浏览器中都可以排序,因为某些原因它会触发事件,但从不进入代码。排序不工作在Firefox,但每隔一个浏览器

$('.column').sortable({ 
     connectWith: '.column', 
     handle: 'h2', 
     cursor: 'move', 
     placeholder: 'placeholder', 
     forcePlaceholderSize: true, 
     opacity: 0.4, 
     start: function (event, ui) { 
      //Firefox, Safari/Chrome fire click event after drag is complete, fix for that 
      if ($.browser.mozilla || $.browser.safari) 
       $(ui.item).find('.dragbox-content').toggle(); 
     }, 
     stop: function (event, ui) { 
      ui.item.css({ 'top': '0', 'left': '0' }); //Opera fix 
       updateWidgetData(); 
     } 
     }) 
.disableSelection(); 
}); 
+0

这是不是一个完整的,可执行的例子。也许http://www.javascriptlint.com/online_lint.php会给你一些想法。 – David

回答

0

如果我没有记错,Firefox不接受具有错误数量的参数作为事件函数的函数。这是根据标准,所以你应该遵守。试试这个:

start: function (event) { 

ui参数不能跟随事件发生的功能。

0

下面是使用jQuery可排序的所有Chrome &火狐代码:

您必须删除线$(#sortable).disableSelection(); jQuery中可排序的代码。 (参考:Sortable | jQuery UI

<script> 
$(function() { 
    $("#sortable").sortable({ 
     placeholder: "ui-state-highlight" 
    });  
}); 
</script> 

希望它帮助;)

0

我做

$("#stores-container").sortable({ 

    stop: function(event, ui) { 

     textareaID = $(ui.item).find(' textarea').attr('id'); 

     textareaVal=$(ui.item).find(' textarea').val(); 

     editorID=$(ui.item).find('.mce-container').attr('id'); 

     $("#"+editorID).remove(); 

     $('#'+textareaID).show(); 
     tinymce.init({selector: '#'+textareaID}); 
    } 

}); 
相关问题