javascript - Fitting blocks inside a container the best possible way -
i have container fixed size (h x w)
im getting images , based on amount of them want fit them container best possible way, keeping in mind latest image must biggest, , forth lets first 3 images, there after can same size.
the images have same size, or rather ratio, lets 640x480. perhaps somehow crop them fit better?
im using javascript this, , css of course.
so have many scenarios example:
1 image - takes whole space 2 images - 50% 50% both 3 images - image 1 biggestm image 2 , 3 same? 4 images - images 1 biggest, 2, 3, 4 smallest
etc
this idea..
Comments
Post a Comment