Isotope Tutorial
Isotope Tutorial
JsTutorialIsotopeFilter&sortmagicallayouts
Slideshow
Tooltip
Autocomplete
Tabs
Scroll
Lightbox
Maps
Charts
Submit Plugin
Search
Search:
Categories:
All
Search
Categories
Slideshow
288
Tooltip
64
Autocomplete
25
97
Tabs
30
Scroll
92
59
Lightbox
136
Maps
24
Charts
31
20
Forms
111
Validation
46
Rating
10
Mobile
31
Captcha
Media
17
35
Text Editor
30
Image editor
15
File Upload
20
Tables
41
15
in Layout
Overview
6731 views
Documents
Demos
Download
Gettingstarted
HTML
Isotope works on a container element with a group of similar child items.
<div id="container">
<div class="item">...</div>
Layout
117
Game
Animation
Others
56
157
CSS
Tags
lightbox
modal box
photo editor
google map
wysiwyg
horizontal scroller
image slider
responsive slider
editor
map
ajax
vertical scroller
share button
jquery ui
InitializewithJavaScript
Initialize an Isotope instance as a jQuery plugin:$('#container').isotope().
var $container = $('#container');
// init
dropdown
tutorial
demos
styled
$container.isotope({
// options
http://jstutorial.com/isotopefiltersortmagicallayouts329
1/6
5/22/2016
JsTutorialIsotopeFilter&sortmagicallayouts
infowindow
metro style
datepicker
itemSelector: '.item',
jquery
layoutMode: 'fitRows'
scrollbar
dialog
sorting
});
Options
animationEngine (String): 'best-available'
Determines the jQuery method to apply styles, .css() or .animate(). Useful for relying on CSS
transitions to handle animation.
Values
'best-available': if browser supports CSS transitions, Isotope uses.css(). If not, falls back
to using.animate().
'css': Isotope uses.css()
'jquery': Isotope uses.animate()
animationOptions (Object): { queue:false, duration:800}
When jQuery is the animation engine (see above), these options will be used in .animate(). See
thejQuery API for animate optionsfor details.
Example
Recent Posts
$('#container').isotope({
Scrollbear
animationOptions: {
174 views
duration: 750,
easing: 'linear',
queue: false
}
});
Greedy Navigation
2152 views
CSS styles applied to the container element. Relative positioning enables absolute positioning on
child items. Hidden overflow ensures that filtered items that lie outside the container do not
interfer with subsequent content.
filter:Selector
Setting a filter with show item elements that match the selector, and hide elements that do not
match. Seedocs on fileringfor more details.
Values
4158 views
Oct 05, 2015 | 0 votes
An object containing one or several methods to retrieve data for Sorting. The methods receive one
parameter ($elemin the example below) which is a jQuery object representing each item element.
The methods need to return a value.
Find us on Facebook
Example
$('#container').isotope({
Javascripttutorials
getSortData : {
6,613likes
LikePage
Share
Bethefirstofyourfriendstolikethis
http://jstutorial.com/isotopefiltersortmagicallayouts329
2/6
5/22/2016
JsTutorialIsotopeFilter&sortmagicallayouts
The style applied to item elements hidden by Filtering.
itemClass(String): 'isotope-item'
The class applied to item elements.
itemPositionDataEnabled(Boolean):false
When enabled, the position of item elements will exposed as data, which you can retrieve with
jQuerys data method with 'isotope-item-position' name space. Position is return as an object
withxandy;
Example
$('#container').isotope({
itemSelector: '.element',
itemPositionDataEnabled: true
})
// log position of each item
.find('.element').each(function(){
var position = $(this).data('isotope-item-position');
console.log('item position is x: ' + position.x + ', y: ' + position.y
);
});
itemSelector (Selector)
Restricts Isotope item elements to selector.
layoutMode (String): 'masonry'
onLayout(Function)
Similiar to a callback, onLayout is a function that will be triggered after every time an Isotope
instance runs through its layout logic.
$('#container').isotope({
onLayout: function( $elems, instance ) {
// `this` refers to jQuery object of the container element
console.log( this.height() );
// callback provides jQuery object of laid-out item elements
$elems.css({ background: 'blue' });
// instance is the Isotope instance
console.log( instance.$filteredAtoms.length );
}
});
resizable(Boolean): true
Triggers layout logic when browser window is resized.
resizesContainer (Boolean): true
Isotope will set the height (for vertical layout modes) or width (for horizontal layout modes) of the
container after layout. IfresizesContaineris set tofalse, be sure to set a size for the container in
your CSS, so it doesnt collapse when Isotope is triggered.
sortAscending(Boolean): true
Used with sorting. If true, items are sorted ascending: 1, 2, 3 or A, B, C. If false, items are
sorted descending Z, Y, X or 9, 8, 7.
sortBy (String)
The property name of the method within thegetSortDataoption to sort item elements.
Values
'original-order'Sorts item elements by their original order.
transformsEnabled (Boolean): true
Isotope uses CSS3 transforms to position item elements, when available in the browser.
SettingtransformsEnabled to false will disable this feature so all browsers use top/left absolute
positioning.
AdditionalCSS
If you do disable transforms, but still want to useCSS transitions, youll need add the following CSS:
.isotope .isotope-item {
-webkit-transition-property: top, left, opacity;
-moz-transition-property: top, left, opacity;
-ms-transition-property: top, left, opacity;
-o-transition-property: top, left, opacity;
http://jstutorial.com/isotopefiltersortmagicallayouts329
3/6
5/22/2016
JsTutorialIsotopeFilter&sortmagicallayouts
transition-property: top, left, opacity;
}
visibleStyle
visibleStyle (Object): { opacity :1, scale :1}
The style applied to item elements made visible by Filtering.
Layoutspecificoptions
In addition the general options listed above, certain layout modes each have their own options. In order
to avoid conflict, these options are set with an option that matches the name of the layout mode.
See docs onlayout modesfor each layout modes available options.
For example, if your layout switched frommasonrytocellsByRow:
$('#container').isotope({
masonry: {
columnWidth: 120
},
cellsByRow: {
columnWidth: 220,
rowHeight: 220
}
});
Methods
Isotope offers several methods to extend functionality. Isotopes 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 not sort, filter or layout.
SeeAdding itemsfor more details. The argument within the callback is the group of elements that were
added.
appended
.isotope( 'appended', $items, callback )
Adds item elements via addItems method, then triggers layout just for those new elements. Useful for
Infinite Scroll. SeeAdding itemsfor more details.
destroy
.isotope( 'destroy' )
Appends items elements to container, adds items to via addItems method, and then
triggersreLayoutmethod so new elements are properly filtered, sorted and laid-out. SeeAdding itemsfor
more details.
layout
.isotope( 'layout', $items, callback )
http://jstutorial.com/isotopefiltersortmagicallayouts329
4/6
5/22/2016
JsTutorialIsotopeFilter&sortmagicallayouts
.isotope( 'option', options )
Sets options for plugin instance. Unlike passing options through .isotope(), using the optionmethod will
not trigger layout.
// sets multiple options
.isotope( 'option', { layoutMode: 'fitRows', filter: '.my-filter' } )
reLayout
.isotope( 'reLayout', callback )
Re-collects all item elements in their current order in the DOM. Useful for prepending.
remove
.isotope( 'remove', $items, callback )
Removes specified item elements from Isotope widget and the DOM.
shuffle
.isotope( 'shuffle', callback )
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.
Layoutmodes
Horizontal layouts
cellsByColumn
cellsByRow
fitColumns
fitRows
masonry
masonryHorizontal
straightAcross
straightDown
Share
Tagged with:
Tweet
ISOTOPE
Like
MAGICAL LAYOUTS
SORTING
Share
LAYOUT MODES
Share
DYNAMIC LAYOUTS
SORTING DATA
INTELLIGENT LAYOUTS
FILTERING
INTEROPERABILITY
Related Articles
http://jstutorial.com/isotopefiltersortmagicallayouts329
5/6
5/22/2016
JsTutorialIsotopeFilter&sortmagicallayouts
Squishy - automatically
resizes text
FlowType.JS - Responsive
web typography
0Comments
Sortby Oldest
Addacomment...
FacebookCommentsPlugin
Get Socials
Newsletters
Subscribe to our newsletters and be informed
of new posts and other Js-tutorial events.
Contact Us
Contact us by email: [email protected]
Enteryouremailaddress
Subscribe
http://jstutorial.com/isotopefiltersortmagicallayouts329
6/6