diff --git a/_posts/custom-layout-modes/2012-01-03-masonry-column-shift.html b/_posts/custom-layout-modes/2012-01-03-masonry-column-shift.html new file mode 100644 index 0000000..1c4ffcd --- /dev/null +++ b/_posts/custom-layout-modes/2012-01-03-masonry-column-shift.html @@ -0,0 +1,220 @@ +--- +title: Masonry Column Shift +layout: default +category: custom-layout-modes +--- + + + +
+

Custom layout mode masonryColumnShift. Enabled columns of a Masonry layout to be shifted and not affect other columns. After the size of an item element has changed, you can trigger a special columnShiftOfItem method that will push the column down. This layout only works with item elements that have the same width

+ +{% highlight javascript %} + +var $container = $('#container'); + +$container.isotope({ + itemSelector: '.shifty-item', + layoutMode: 'masonryColumnShift' +}); + +$container.find('.shifty-item').hover( + function() { + $(this).css({ height: "+=100" }); + // note that element is passed in, not jQuery object + $container.isotope( 'shiftColumnOfItem', this ); + }, + function() { + $(this).css({ height: "-=100" }); + $container.isotope( 'shiftColumnOfItem', this ); + } +); + +{% endhighlight %} + +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + + + \ No newline at end of file