mirror of https://github.com/metafizzy/isotope
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.
24 lines
900 B
24 lines
900 B
|
|
// change layout |
|
var isHorizontal = false; |
|
function changeLayoutMode( $link, options ) { |
|
var wasHorizontal = isHorizontal; |
|
isHorizontal = $link.hasClass('horizontal'); |
|
|
|
if ( wasHorizontal !== isHorizontal ) { |
|
// orientation change |
|
// need to do some clean up for transitions and sizes |
|
var style = isHorizontal ? |
|
{ height: '80%', width: $container.width() } : |
|
{ width: 'auto' }; |
|
// stop any animation on container height / width |
|
$container.filter(':animated').stop(); |
|
// disable transition, apply revised style |
|
$container.addClass('no-transition').css( style ); |
|
setTimeout(function(){ |
|
$container.removeClass('no-transition').isotope( options ); |
|
}, 100 ) |
|
} else { |
|
$container.isotope( options ); |
|
} |
|
}
|
|
|