html layout 插件,Isotope · Layout modes_jQuery之家-自由分享jQuery、html5、css3的插件库...

Layout modes

Isotope has a versatile layout engine allowing you to position items with different layout logic. Set and change layout mode with the layoutMode option.

masonry

fitRows

cellsByRow

vertical

packery

masonryHorizontal

fitColumns

cellsByColumn

horizontal

$container.isotope({...})

1

2

3

4

5

6

7

8

9

10

11

12

Layout mode options

Layout modes can have their own separate options. These are set in a corresponding object within the options.

var $container = $('#container').isotope({

// main isotope options

itemSelector: '.item',

layoutMode: 'cellsByRow',

// options for cellsByRow layout mode

cellsByRow: {

columnWidth: 200,

rowHeight: 150

},

// options for masonry layout mode

masonry: {

columnWidth: '.grid-sizer'

}

})

Horizontal layouts

Horizontal layout modes (masonryHorizontal, fitColumns, cellsByColumn, and horizontal) need a container that has a height value. Be sure that your CSS has height set.

#container {

/* either of these will work for horizontal Isotope layouts */

height:80%;

height:480px;

}

Included modes

masonry, fitRows, and vertical are included in isotope.pkgd.js and if you install Isotope via Bower. All other layout modes need to installed separately.

masonry

The default layout mode. Items are arranged in a vertically cascading grid.

masonry: {

columnWidth: 50

}

fitRows

Items are arranged into rows. Rows progress vertically. Similar to what you would expect from a layout that uses CSS floats.

fitRows is ideal for items that have the same height.

cellsByRow

A vertical grid layout where items are centered inside each cell. The grid is defined by columnWidth and rowHeight options.

layoutMode: 'cellsByRow',

cellsByRow: {

columnWidth: 110,

rowHeight: 110

}

vertical

Items are stacked vertically.

masonryHorizontal

Horizontal version of masonry. Items are arranged in a horizontally cascading grid.

layoutMode: 'masonryHorizontal',

masonry: {

rowHeight: 50

}

fitColumns

Items are arranged into columns. Columns progress horizontally.

fitColumns is ideal for items that have the same width.

cellsByColumn

A horizontal grid layout where items are centered inside each cell. The grid is defined by columnWidth and rowHeight options.

layoutMode: 'cellsByColumn',

cellsByColumn: {

columnWidth: 110,

rowHeight: 110

}

horizontal

Items are arranged horizontally.

layoutMode: 'horizontal'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值