Last active
August 29, 2015 14:16
-
-
Save robinbastien/5a93ce324bd4b326a5e6 to your computer and use it in GitHub Desktop.
Gravity Forms - Grid Framework for gform fields
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
// Make form work with grid framework | |
$(document).bind('gform_post_render', function(){ | |
$('.gform_fields').addClass('grid'); | |
$('.gfield input, .gfield_html, .gfield textarea,.gfield select,.gfield h3, .gfield h2, .gfield p').each(function() { | |
if($(this).parents('.gfield').hasClass('cell')) { | |
} else if($(this).hasClass('small')) { | |
$(this).parents('.gfield').addClass('cell lap-1-3'); | |
} else if($(this).hasClass('medium')) { | |
$(this).parents('.gfield').addClass('cell lap-1-2'); | |
} else { | |
if($(this).hasClass('gfield')) { | |
$(this).addClass('cell'); | |
} else { | |
$(this).parents('.gfield').addClass('cell'); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment