From 039da68704fdf76d4139730421ef29a32e75ae4a Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 9 Feb 2012 07:54:19 -0500 Subject: [PATCH] docs : add example for onLayout --- _posts/docs/2010-12-03-options.mdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/_posts/docs/2010-12-03-options.mdown b/_posts/docs/2010-12-03-options.mdown index 4d5d912..b153259 100644 --- a/_posts/docs/2010-12-03-options.mdown +++ b/_posts/docs/2010-12-03-options.mdown @@ -220,6 +220,19 @@ See also docs on [Layout modes](layout-modes.html). Similiar to a callback, `onLayout` is a function that will be triggered after every time an Isotope instance runs through its layout logic. +{% highlight javascript %} + +$('#container').isotope({ + onLayout: function( $elems ) { + // `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' }); + } +}); + +{% endhighlight %} + ## resizable