Traditional plug-in class waterfalls flow cannot very good solve the problem of page performance, loading process is very redundant, especially if you use a similar jQuery masonry and other plug-ins, believe you know what I mean, hey hey, and for the elements of the pixel level control effect is not very in place, and often rely on some third-party libraries, Such as jQuery

In this article today, Grandpa I will introduce a good JS library – bricks. JS, the following are some of its advantages:

  • No HTML tags or CSS styles are required
  • Simplified and powerful readable code configuration
  • Optional size change function operation
  • Optimized add element operation

This plugin is open source and can be easily downloaded and used on Github. It is very powerful and generates thousands of elements in milliseconds. You can check out the demo here:

The script is very simple to use, passing in only three parameters:

  1. Container: A DOM Container element is used to hold elements
  2. Packed: a property that defines how elements are arranged
  3. Sizes: an array of pixel-level drops that set the width and spacing of elements

For more configuration information, please refer to related documents as follows:…

If you have more good suggestions and usage, please leave a comment to me