jquery.vgrid.js
可変グリッドレイアウトのjQueryプラグイン書いたよ | Xlune::Blogを利用しようと思ってみてるところ。
要望として「refreshで動かさないセルが欲しい」とあったので、ちょっと修正
- 動かさないセル(div)にclassとしてvgfixedをつける
jquery.vgrid.0.1.6.jsの340行目
vgsort: function(func, easeing, time, delay) { var _obj = $(this); if(_obj.data("_vgchild")) { _obj.data("_vgchild", _obj.data("_vgchild").sort(func)); _obj.data("_vgchild").each(function(num){ $(this).appendTo(_obj); }); makePos(_obj); animateTo( _obj.data("_vgchild"), easeing || _obj.data("_vgopt").easeing || "linear", typeof(time)=="number" ? time : _obj.data("_vgopt").time || 500, typeof(delay)=="number" ? delay : _obj.data("_vgopt").delay || 0 ); } return _obj; }
を
vgsort: function(func, easeing, time, delay) { var _obj = $(this); if(_obj.data("_vgchild")) { var _fixed = _obj.data("_vgchild").filter(function(i, o){ return $(o).hasClass('vgfixed')}); _obj.data("_vgchild", $.merge(_fixed, _obj.data("_vgchild").filter(function(i, o){ return !$(o).hasClass('vgfixed')}).sort(func))); _obj.data("_vgchild").each(function(num){ $(this).appendTo(_obj); }); makePos(_obj); animateTo( _obj.data("_vgchild"), easeing || _obj.data("_vgopt").easeing || "linear", typeof(time)=="number" ? time : _obj.data("_vgopt").time || 500, typeof(delay)=="number" ? delay : _obj.data("_vgopt").delay || 0 ); } return _obj; }
とした