如何取消portlet中的标题和内容的可排序

时间:2012-02-07 14:16:33

标签: javascript jquery jquery-ui

我想取消两个div类的可排序portlet选项。我尝试过以下编码,

My Div:

<div class="column">
    <div class="portlet>
       <div class="portlet-header 
       <div class="portlet-content">
    </div>
  </div>

尝试取消排序:

$( ".column").sortable( "option", "cancel", '.portlet-header');    
$( ".column").sortable( "option", "cancel", '.portlet-content');

它不会取消标题和内容的排序。但是如果我只取消标题,否则取消否则仅取消内容,它会取消正确。我想对两者进行取消排序。如何取消标题和内容?

3 个答案:

答案 0 :(得分:1)

 $(".column").sortable("option", "cancel", ".portlet-header, .portlet-content"); 

此代码工作正常..

答案 1 :(得分:0)

尝试

$(".column").sortable("option", "cancel", ".portlet-header, .portlet-content");

答案 2 :(得分:0)

         $( ".column" ).sortable({
            items: "div:not(.portlet-header,.portlet-content)"
        });

检查你的HTML,至少它看起来无效:

<div class="portlet-header

'&GT;'缺少

<div class="portlet-header">