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..

one image only one image only enter code here


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -