File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Gravity Perks // Page Transitions // Disable Auto Height
4+ * https://gravitywiz.com/documentation/gravity-forms-page-transitions/
5+ *
6+ * This snippet disables Swiper's auto height and forces all slides to match the height of the tallest slide.
7+ */
8+ // Update "123" to your form ID
9+ $ target_form_id = 123 ;
10+
11+ add_filter ( "gppt_script_args_ {$ target_form_id }" , function ( $ args , $ form ) {
12+ $ args ['transitionSettings ' ]['autoHeight ' ] = false ;
13+ return $ args ;
14+ }, 10 , 2 );
15+
16+ add_filter ( "gform_pre_render_ {$ target_form_id }" , function ( $ form ) {
17+ add_action ( 'wp_head ' , 'disable_auto_height_styles ' );
18+ return $ form ;
19+ });
20+
21+ add_action ( 'gform_preview_footer ' , function ( $ form_id ) use ( $ target_form_id ) {
22+ if ( $ form_id == $ target_form_id ) {
23+ disable_auto_height_styles ();
24+ }
25+ });
26+
27+ function disable_auto_height_styles () {
28+ ?>
29+ <style>
30+ .gppt-has-page-transitions .swiper-slide {
31+ height: auto;
32+ align-self: stretch;
33+ }
34+ </style>
35+ <?php
36+ }
You can’t perform that action at this time.
0 commit comments