EduardET

equalize blurb height

Jan 12th, 2018
103
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.  
  17.         $( window ).resize( function() {
  18.             setHeight( $( '.et_pb_main_blurb_image' ) );
  19.         } )
  20.         setHeight( $( '.et_pb_main_blurb_image' ) );
  21.     } );
  22. } )( jQuery );
  23. </script>
Advertisement
Add Comment
Please, Sign In to add comment