Skip to content

Commit

Permalink
Update jquery.row-grid.js
Browse files Browse the repository at this point in the history
  • Loading branch information
brunjo committed Feb 9, 2014
1 parent 04e54eb commit fd59c6e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions jquery.row-grid.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function( $ ) {
(function($){
$.fn.rowGrid = function( options ) {
if(options === "appended") {
options = this.data("grid-options");
Expand Down Expand Up @@ -73,14 +73,15 @@
$rowElem.addClass(options["firstItemClass"]);
}
var rowElemWidth = $rowElem.outerWidth();
var ratio = rowElemWidth / rowWidth;
var newWidth = rowElemWidth - (rowElemWidth / rowWidth) * diff;
$rowElem
.css("width", rowElemWidth - ratio * (diff))
.css("width", newWidth)
.css("height", $rowElem.height() * (newWidth / rowElemWidth))
.css("margin-right", (rowElemIndex < rowElems.length - 1)?rowMargin : 0);
}
rowElems = [];
rowWidth = 0;
}
});
};
})( jQuery );
});
};
})(jQuery);

0 comments on commit fd59c6e

Please sign in to comment.