- * @param {[type]} images the images to be calculated
- * @param {[type]} width the container witdth
- * @param {[type]} margin the margin between each image
- *
- * @return {[type]} the height
- */
- ImageLayout.prototype._getHeigth = function (images, width) {
- var i, img;
- var r = 0;
-
- for (i = 0; i < images.length; i++) {
- img = images[i];
- if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
- r += img.naturalWidth / img.naturalHeight;
- } else {
- // assume that not loaded images are square
- r += 1;
- }
- }
-
- return (width - images.length * this.verticalMargin) / r; // have to round down because Firefox will automatically roundup value with number of decimals > 3
- };
-
- ImageLayout.prototype._setSize = function (images, height) {
- var i, img, imgWidth;
- var imagesLength = images.length, resultNode;
-
- for (i = 0; i < imagesLength; i++) {
- img = images[i];
- if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
- * @param {[type]} images the images to be calculated
- * @param {[type]} width the container witdth
- * @param {[type]} margin the margin between each image
- *
- * @return {[type]} the height
- */
- ImageLayout.prototype._getHeigth = function (images, width) {
- var i, img;
- var r = 0;
-
- for (i = 0; i < images.length; i++) {
- img = images[i];
- if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
- r += img.naturalWidth / img.naturalHeight;
- } else {
- // assume that not loaded images are square
- r += 1;
- }
- }
-
- return (width - images.length * this.verticalMargin) / r; // have to round down because Firefox will automatically roundup value with number of decimals > 3
- };
-
- ImageLayout.prototype._setSize = function (images, height) {
- var i, img, imgWidth;
- var imagesLength = images.length, resultNode;
-
- for (i = 0; i < imagesLength; i++) {
- img = images[i];
- if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {