Created
March 24, 2021 17:21
-
-
Save AchalJ/1d2529616e99ad3f0218a07db8e0108d to your computer and use it in GitHub Desktop.
PowerPack Content Grid - Equal Align Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .pp-post-equal-align .pp-post-body { | |
| height: 100%; | |
| } | |
| .pp-post-equal-align:not(.pp-content-alternate) .pp-post-body { | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .pp-post-equal-align .pp-post-info { | |
| height: 100%; | |
| } | |
| .pp-post-equal-align .pp-content-body { | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .pp-post-equal-align:not(.pp-content-alternate) .pp-content-body { | |
| height: 100%; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function($) { | |
| $('.pp-post-equal-align').on('grid.afterInit', function() { | |
| var gridVar = 'ppcg_' + $(this).data('node'); | |
| if ( 'undefined' === typeof window[gridVar] ) { | |
| return; | |
| } | |
| var grid = window[gridVar]; | |
| $(this).find('.pp-content-post').each(function() { | |
| $(this).find('.pp-content-grid-image').wrapAll('<div class="pp-post-body"></div>'); | |
| $(this).find('.pp-content-grid-inner').appendTo( $(this).find('.pp-post-body') ); | |
| $(this).find('.pp-content-grid-title').wrapAll('<div class="pp-post-info"></div>'); | |
| $(this).find('.pp-content-grid-content').appendTo( $(this).find('.pp-post-info') ); | |
| $(this).find('.pp-content-grid-more-link').wrapAll('<div class="pp-post-action"></div>'); | |
| $(this).find('.pp-post-info').unwrap(); | |
| }); | |
| setTimeout(function() { | |
| grid._gridLayoutMatchHeight(); | |
| }, 100); | |
| $(window).on('resize', function() { | |
| grid._gridLayoutMatchHeight(); | |
| if ($(grid.wrapperClass).data('isotope')) { | |
| $(grid.wrapperClass).isotope('layout'); | |
| } | |
| }); | |
| }); | |
| })(jQuery); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions
pp-post-equal-alignto the Content Grid module (under Advanced tab > Class field)