Home >Web Front-end >JS Tutorial >Waterfall flow layout and automatic loading of implementation code_jquery

Waterfall flow layout and automatic loading of implementation code_jquery

WBOY
WBOYOriginal
2016-05-16 17:40:48695browse

Since Pinterest succeeded in using a new layout method, a layout trend has appeared on the Internet. We call it waterfall flow! ! It became popular on the Internet and is ubiquitous from abroad to home. There are currently representative websites in China such as Meilishuo, Mogujie, and Huaban.

Waterfall flow has been popular for some time, and now there are many plug-ins on the Internet. It is very convenient to use. It is currently used a lot, and there is a juqery plug-in masonry. The plug-in address is: http://masonry.desandro.com/

First use css to lay out a web page from top to bottom.
It is very convenient to use:

I first quote the jquery file and masonry file, and use the following code:

Copy the code The code is as follows:

$(function(){
var $container = $('#container');
$container.imagesLoaded( function() {
$container.masonry({
itemSelector : '.content_box',
isFitWidth: true,//// Whether it is resizable Boolean
isRTL:false ////Use right to Left layoutBoolean
});
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn