Methods

Isotope offers several methods to extend functionality. Isotope’s methods follow the jQuery UI pattern.

$('#container').isotope( 'methodName', [optionalParameters] )

addItems

.isotope( 'addItems', $items, callback )

Adds item elements to the pool of item elements of the container, but does sort, filter or layout. See Adding items for more details. The argument within the callback is the group of elements that were added.

See Demo: Adding items

appended

.isotope( 'appended', $items, callback )

Adds item elements via addItems method, then triggers layout just for those new elements. Useful for Infinite Scroll. See Adding items for more details.

See Demo: Adding items

destroy

.isotope( 'destroy' )

Removes Isotope functionality completely. Returns element back to pre-init state.

insert

.isotope( 'insert', $items, callback )

Appends items elements to container, adds items to via addItems method, and then triggers reLayout method so new elements are properly filtered, sorted and laid-out. See Adding items for more details.

See Demo: Adding items.

layout

.isotope( 'layout', $items, callback )

Positions specified item elements in layout.

layout will only position specified elements, and those elements will be positioned at the end of layout. Whereas reLayout will position all elements in the Isotope widget.

option

.isotope( 'option', options )

Sets options for plugin instance. Unlike passing options through .isotope(), using the option method will not trigger layout.

// sets multiple options
.isotope( 'option', { layoutMode: 'fitRows', filter: '.my-filter' } )

reLayout

.isotope( 'reLayout', callback )

Resets layout properties and lays-out every item element.

See Demo: reLayout

reloadItems

.isotope( 'reloadItems' )

Re-collects all item elements in their current order in the DOM. Useful for prepending.

See Demo: Adding items.

remove

.isotope( 'remove', $items )

Removes specified item elements from Isotope widget and the DOM.

shuffle

.isotope( 'shuffle', callback )

Shuffles order of items. Sets sortBy option to 'random'.

updateSortData

.isotope( 'updateSortData', $items )

Updates the sorting data on specified item elements. This method is useful if the data within an item is changed dynamically after Isotope has been initialized.

下载代码说明
X关闭

Isotope 基于jQuery的智能布局插件实例大全

Isotope - jQuery智能布局插件。Isotope绝对是一个令人难以置信的jQuery插件,你可以用它来创建动态和智能布局。你可以隐藏和显示与过滤项目,重新排序和整理甚至更多,同时Isotope还有许多很酷的动画。所附带的示例包括网页中常见到一些实用特效,都是一些经典的特效。