enmi12/glossaire/_includes/layout-change.js
changeset 0 d970ebf37754
equal deleted inserted replaced
-1:000000000000 0:d970ebf37754
       
     1 
       
     2       // change layout
       
     3       var isHorizontal = false;
       
     4       function changeLayoutMode( $link, options ) {
       
     5         var wasHorizontal = isHorizontal;
       
     6         isHorizontal = $link.hasClass('horizontal');
       
     7 
       
     8         if ( wasHorizontal !== isHorizontal ) {
       
     9           // orientation change
       
    10           // need to do some clean up for transitions and sizes
       
    11           var style = isHorizontal ? 
       
    12             { height: '80%', width: $container.width() } : 
       
    13             { width: 'auto' };
       
    14           // stop any animation on container height / width
       
    15           $container.filter(':animated').stop();
       
    16           // disable transition, apply revised style
       
    17           $container.addClass('no-transition').css( style );
       
    18           setTimeout(function(){
       
    19             $container.removeClass('no-transition').isotope( options );
       
    20           }, 100 )
       
    21         } else {
       
    22           $container.isotope( options );
       
    23         }
       
    24       }