EduardET

Gallery Items same height

Jan 30th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.     $( document ).ready( function() {
  4.         var galleryItem = $( '#custom_gallery .et_pb_gallery_items .et_pb_gallery_item' );
  5.  
  6.         function setHeight( el ) {
  7.             var maxHeight = 0;
  8.             if ( el.length ) {
  9.                 el.each( function() {
  10.                     if ( $( this ).outerHeight() > maxHeight ) {
  11.                         maxHeight = $( this ).outerHeight();
  12.                     }
  13.                 } );
  14.  
  15.                 el.css( 'min-height', maxHeight );
  16.             }
  17.         }
  18.         setHeight(galleryItem);
  19.     } );
  20. } )( jQuery );
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment