|
Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://wiki.cs.msu.ru/System/JQueryMasonry?cover=print;
Дата изменения: Unknown Дата индексирования: Sun Apr 10 14:41:42 2016 Кодировка: |
Masonry is a layout plugin for jQuery. Think of it as the flip side of CSS floats. Whereas floating arranges elements horizontally then vertically, Masonry arranges elements vertically then horizontally according to a grid. The result minimizes vertical gaps between elements of varying height, just like a mason fitting stones in a wall.
See the jQuery Masonry Collection on Ember for more screenshots
of jQuery masonry in the wild.
.masonry() method
to the wrapping container element in your jQuery script. Depending on the layout,
you’ll most likely need to specify one option.
For layouts with elements that span multiple widths:
$('#wrapper').masonry({ columnWidth: 200 });
For layouts with elements that span the same width:
$('#wrapper').masonry({ singleMode: true });
jqMasonry will be processed by this plugin. Options can be specified
using JQueryMetadata.
Masonry offers several methods to extend functionality. Masonry’s methods follow the jQuery UI pattern.
$('#container').masonry( 'methodName', [optionalParameters] )
.masonry( 'appended', $content, isAnimatedFromBottom )
Triggers layout on item elements that have been appended to the container.
.masonry( 'destroy' )
Removes Masonry functionality completely. Returns element back to pre-initialized state.
.masonry( '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 .masonry() will position all items in the Masonry instance.
.masonry( 'option', options )
Sets options for plugin instance. Unlike passing options through .masonry(), using the option method will not trigger layout.
// set multiple options
.masonry( 'option', { columnWidth: 120, isAnimated: false } )
.masonry( 'reloadItems' )
Re-collects all item elements in their current order in the DOM.
.masonry( 'reload' )
Convenience method for triggering reloadItems then .masonry(). Useful for prepending or inserting items.
.masonry( 'remove', $items )
Removes specified item elements from Masonry instance and the DOM.
Copyright © by the contributing authors. All material on this site is the property of the contributing authors.