ここに単純なテーブル列リサイザーを作成しました:
これにはプラグインを使用できませんが、このプラグインの機能を模倣する必要があります。
http://quocity.com/colresizable/
列のサイズをうまく変更できましたが、カーソルをハンドルから離すことができます (th の灰色のボックス)。マウスを動かしてもカーソルがハンドル上にとどまるように、何らかの形でカーソルを拘束する必要があります。上記のプラグインのソースコードを調べましたが、これを実現する方法については何の光も当てていません。
私のjsコードは進行中の作業であり、現時点ではかなりラフです:
$(document).ready(function () {
var th,
previousColIndex,
nextColIndex,
previousColWidth,
nextColWidth,
thWidth,
currentXPos;
$('.resize').mousedown(function(e) {
currentXPos = e.pageX;
th = $(this).parent();
nextColIndex = th.index() + 1;
nextColWidth = $('table tr th').eq(nextColIndex).width();
thWidth = th.width();
$(document).bind('mousemove',function(e){
if(e.pageX < currentXPos) {
thWidth = thWidth - 1;
nextColWidth = nextColWidth + 1;
$('table tr td').eq(th.index()).css({'width': thWidth + 'px'});
th.css({'width':thWidth + 'px' });
$('table tr td,table tr th').eq(nextColIndex).css({'width': nextColWidth + 'px'});
currentXPos = e.pageX;
} else {
thWidth = thWidth + 1;
nextColWidth = nextColWidth - 1;
$('table tr td').eq(th.index()).css({'width': thWidth + 'px'});
th.css({'width':thWidth + 'px' });
$('table tr td,table tr th').eq(nextColIndex).css({'width': nextColWidth + 'px'});
currentXPos = e.pageX;
}
})
}).mouseup(function(){
$(document).unbind('mousemove');
})
$(document).mouseup(function() {
$(document).unbind('mousemove');
})
})