
00

01
< ;div class="cell">

02
A brief analysis of waterfall flow layout
Toss: waterfall flow layout (implemented based on multi-column list fluid layout)
javascript waterfall flow, Brief analysis and suggestions of major waterfall flows
Because I use jquery a lot, I came up with the idea of making waterfall flow into a plug-in. Let’s borrow the beautiful pictures from Xunlei UED.
Take a look firstDemo
Publish the code
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
The following is a detailed description of the functions and default values of each attribute of the configuration parameter object opt.
column_width:204 //Waterfall flow is composed of columns. This parameter specifies the width of each column. This parameter will directly affect the number of columns in the waterfall flow
column_className:'waterfall_column' //The class name of the column, easy to customize the style
column_space:10 //The spacing between columns
cell_selector:'.cell' //The selector of the bricks to be arranged is limited to the container of the waterfall flow, that is, the plug-in obtains the brick elements through this selector, and is Find elements matching this selector within the waterfall container.
img_selector:'img' //Selector for the image to be loaded. If the theme content of the brick elements to be loaded by your waterfall flow is images of varying sizes, then this parameter is the selector of these images, and the plug-in needs to obtain these images for calculation.
auto_imgHeight:true //Do you need to automatically calculate the height of the image? If the size of the image is fixed, set this parameter to false
fadein:true // Whether to fade in and load
fadein_speed:600 //Fade in speed in milliseconds
insert_type:1 //Brick insertion method, 1 means inserting the shortest column, 2 means inserting in sequence
getResource:function(index,render){ } //Get the dynamic resource function, which must return a collection of brick elements. The first parameter index passed in is the number of times it has been loaded. The second parameter is the number of times it has been loaded. The first parameter is the rendering function, which can accept a collection of brick elements as a parameter. If you use ajax to load data, you must manually call the function to render after getting the data. This function is automatically triggered every time the bottom of the waterfall is reached to load more resources.
Comment time:
The content loaded by waterfall flow is generally pictures with the same width and different heights. If the height of the picture can be known in advance, it will be much simpler. But if not, you must wait until the picture is loaded before you can calculate the height of the picture. This This is the most annoying part of the waterfall flow. It is precisely because of this that if the height of the pictures is unknown, the order of insertion may be a little confusing, and the refresh order is different every time, because the order in which each picture is loaded is not the same. It's not fixed, maybe this time is faster, next time that is faster. Therefore, if the height of the image is not known in advance, the height of the entire brick will also be unknown. The height of the brick must be calculated after the image in the brick is loaded. If this is the case but you want to ensure the insertion order of bricks, it is recommended to insert bricks in sequence, that is, set the insert_type parameter to 2. Because it is a plug-in, ease of use must be considered, but the easier it is to use, the more complex the plug-in will be inside, and the number of loopholes and bugs will increase, so I will continue to improve this plug-in.
This plug-in supports IE6, chrome, firefox, opera, safari and other mainstream browsers.
AI-powered app for creating realistic nude photos
Online AI tool for removing clothes from photos.
Undress images for free
AI clothes remover
Generate AI Hentai for free.
Easy-to-use and free code editor
Chinese version, very easy to use
Powerful PHP integrated development environment
Visual web development tools
God-level code editing software (SublimeText3)
Article discusses creating, publishing, and maintaining JavaScript libraries, focusing on planning, development, testing, documentation, and promotion strategies.
The article discusses strategies for optimizing JavaScript performance in browsers, focusing on reducing execution time and minimizing impact on page load speed.
Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...
The article discusses effective JavaScript debugging using browser developer tools, focusing on setting breakpoints, using the console, and analyzing performance.
The article explains how to use source maps to debug minified JavaScript by mapping it back to the original code. It discusses enabling source maps, setting breakpoints, and using tools like Chrome DevTools and Webpack.
This article explores effective use of Java's Collections Framework. It emphasizes choosing appropriate collections (List, Set, Map, Queue) based on data structure, performance needs, and thread safety. Optimizing collection usage through efficient
Once you have mastered the entry-level TypeScript tutorial, you should be able to write your own code in an IDE that supports TypeScript and compile it into JavaScript. This tutorial will dive into various data types in TypeScript. JavaScript has seven data types: Null, Undefined, Boolean, Number, String, Symbol (introduced by ES6) and Object. TypeScript defines more types on this basis, and this tutorial will cover all of them in detail. Null data type Like JavaScript, null in TypeScript
This tutorial will explain how to create pie, ring, and bubble charts using Chart.js. Previously, we have learned four chart types of Chart.js: line chart and bar chart (tutorial 2), as well as radar chart and polar region chart (tutorial 3). Create pie and ring charts Pie charts and ring charts are ideal for showing the proportions of a whole that is divided into different parts. For example, a pie chart can be used to show the percentage of male lions, female lions and young lions in a safari, or the percentage of votes that different candidates receive in the election. Pie charts are only suitable for comparing single parameters or datasets. It should be noted that the pie chart cannot draw entities with zero value because the angle of the fan in the pie chart depends on the numerical size of the data point. This means any entity with zero proportion