Tuesday, 3 September 2013

How does Pinterest keep their image height proportionate

How does Pinterest keep their image height proportionate

I want to load in a bunch of random images (of varying widths and heights)
to a column. The column will have a fixed width, and the height will have
to be cropped off proportionally to keep the image in it's original height
to width ratio. (similar to how Pinterest structures their boards.)
Anyone know how this could be accomplished with Javascript or JQuery?

No comments:

Post a Comment