Filter & sort magical layouts http://isotope.metafizzy.co
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
826 B

// change layout
var isHorizontal = false;
$('#layouts a').click(function(){
var mode = $(this).attr('href').slice(1);
wasHorizontal = isHorizontal;
isHorizontal = $(this).hasClass('horizontal');
if ( wasHorizontal !== isHorizontal ) {
// need to do some clean up for transitions and sizes
var style = isHorizontal ?
{ height: '80%', width: $demo.width() } :
{ width: 'auto' };
$demo.addClass('no-transition').css( style );
setTimeout(function(){
$demo.removeClass('no-transition').isotope({ layoutMode : mode });
}, 100 )
} else {
// go ahead and apply new layout
$demo.isotope({ layoutMode : mode });
}
return false;
});