javascript - Isotope: Resize elements before reLayout -
i want resize elements, in isotope grid.
i dont want happen each time window resizes. want before relayout function of isotope.
is there way can this? callback before relayout?
thanx!
i found way. extending isotope centered masonry mode. in extended resize function, made resize changes on isotope elements, triggered resize(dont know sure if proper way), , did trick.
now everytime isotope wants relayout, before it, resize elements!
here code:
$.isotope.prototype._masonryresizechanged = function () { // resize elements //code sets new width elements // force relayout $('#container').isotope( 'relayout'); //rest of overriden method var prevcolcount = this.masonry.cols; // updated colcount this._getcenteredmasonrycolumns(); return ( this.masonry.cols !== prevcolcount ); };
Comments
Post a Comment