开发者

new google images how do they float correctly

Has anyone seen the new google image search. It manages to make the images float in an area. the images fit into this correctly by grouping them in the sizes.

Frog images

I guess there are two ways of doing this:

  • Scripting by some sort of rule involving the widths and heights of these images
  • A Css rule for creating the images.

In a scripting scenario we could use a max width of 1000px then group up images to fill this 4 times for our 4 lines of images.

The Css rule would have to make the images float but also re order them.

Does开发者_StackOverflow社区 anyone have any other ideas on how this would work?


They re-size images with canvas js. Then set li width, height and then add overflow hidden. You also can get same result if you set width on all your images in css img.myimg {width:70px}. I don't think it will take longer to render the page then using js code.


I think google doing all these staf on server: try to resize window - it will be reloaded in a sercond with resized images. On the other hand I found a canvas element that also could be used to resize loaded images with js

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜