EduardET

differnt cols - same height for TM

Dec 18th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         function setHeight( el ) {
  5.             var maxHeight = 0;
  6.             if ( el.length ) {
  7.                 el.each( function() {
  8.                     if ( $( this ).height() > maxHeight ) {
  9.                         maxHeight = $( this ).height();
  10.                     }
  11.                 } );
  12.  
  13.                 el.css( 'min-height', maxHeight );
  14.             }
  15.         }
  16.         if ( $( window ).width() > 980 ) {
  17.             setHeight( $( ".wpc-col-2 .product-description" ) );
  18.             setHeight( $( ".wpc-col-3 .product-description" ) );
  19.             setHeight( $( ".wpc-col-4 .product-description" ) );
  20.         }
  21.  
  22.         $( window ).resize( function() {
  23.             if ( $( window ).width() > 980 ) {
  24.                 setHeight( $( ".wpc-col-2 .product-description" ) );
  25.                 setHeight( $( ".wpc-col-3 .product-description" ) );
  26.                 setHeight( $( ".wpc-col-4 .product-description" ) );
  27.             }
  28.         } )
  29.     } );
  30. } )( jQuery );
  31. </script>
Advertisement
Add Comment
Please, Sign In to add comment