Waterfall flow effects are divided into two categories: Mushroom Street effect (first: Fixed number of columns), Baidu picture/Petal Net (second: With the size of the window number of columns change)
Issues related to:
1. Data problems (Applied technology: AJAX/JSONP)
2. How the data is displayed on the page after loading, showing the effect.
The first type: the number of fixed columns in Mushroom Street
Principle:
A UL, if there are four columns, there are four li (floating positioning, width in advance definition, but height is not defined), if a one-time loading 10 data, then a left-to-right fill Li, fill a screen and then load, look for the smallest column fill.
The second kind: Baidu picture, petal net (varies with window size number of columns)
Principle:
The page contains a container (set to fixed positioning), and all the pictures are placed inside the container. When the image is displayed, we have to calculate the total number of columns, and then calculate the total width of the container based on the number of columns and the width of each column. When the picture is displayed, the columns are populated from left to right, and when a screen fills up, the shortest column is searched, and then
Add a picture to the shortest column.
Waterfall Flow principle