2012-02-29 10 views

答えて

0

私は実際にそれをやっています。 jquery-uiのメソッドsortable()とportlet()を使用して独自のプラグインを作成しました。ここに私のコードは次のとおりです。助け

$(document).ready(function(){ 
    $('#jobTable').jSortable(); 
}); 

希望:

(function($){ 
$.fn.jSortable = function(){ 

    var element = this; 
    var fixHelper = function(e, ui) { 
     ui.children().each(function(){ 
      $(this).width($(this).width()); 
     }); 
     return ui; 
    }; 

    $(element).find("div.odd").addClass("odd2"); 
    $(element).find("div.even").addClass("odd2"); 
    $(element).find("div.job-items-block").hide(); 

    $(element).sortable({ 
     distance: "30" 

    }); 

    $(".full-job-portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix") 
     .find(".odd2") 
      .addClass("ui-widget-header") 
      .end() 
     .find(".job-items-block"); 

    $(".odd2").click(function(){ 
     $(this).parents(".full-job-portlet:first").find(".job-items-block").slideToggle(); 
    }); 
    $(element).disableSelection(); 
}; 

})(jQuery); 

はその後、私のhtmlで私が入れ。

関連する問題