私は、グリスタのコンテナを自動サイズ変更する方法を見つけようとしています。グリッター、ブラウザサイズの変更に自動調整する方法は?
ユーザーがブラウザのサイズを変更すると、対応するグリッドウィジェットのサイズが変更されます。私が更新する方法を見つけることができませんでしたが、私は、ブラウザのサイズが変更、
として「widget_base_dimensions」の値を計算することができ (列数と行数が変化しないで、実際のサイズがします)
/新しいサイズに対処するためにウィジェットに実行します。
このような機能をサポートしている機能がある場合は、私が求めていたと私はjquery.gridster.js上のライン3529上の
、
/**
* Recalculates the offsets for the faux grid. You need to use it when
* the browser is resized.
*
* @method recalculate_faux_grid
* @return {Object} Returns the instance of the Gridster class.
*/
fn.recalculate_faux_grid = function() {
var aw = this.$wrapper.width();
this.baseX = ($(window).width() - aw)/2;
this.baseY = this.$wrapper.offset().top;
$.each(this.faux_grid, $.proxy(function(i, coords) {
this.faux_grid[i] = coords.update({
left: this.baseX + (coords.data.col -1) * this.min_widget_width,
top: this.baseY + (coords.data.row -1) * this.min_widget_height
});
}, this));
return this;
};
が、私はそれらを活用する方法いくつかにしようとしたことに気づきましたしかし、誰もが正常にこのコードを使用したり回避されている場合:(
を失敗した、あなたは私を助けてくださいことができますか?
これで運が良かったですか? – Cole
基本寸法 '.gridster li {width:34%;}'にマヌエル幅を定義すると、それは画面に合うようになります – Harish
Packery.jsのグリッターがサポートされなくなったようです – Denis