Skip to content

Instantly share code, notes, and snippets.

@robinbastien
Last active August 29, 2015 14:16
Show Gist options
  • Save robinbastien/5a93ce324bd4b326a5e6 to your computer and use it in GitHub Desktop.
Save robinbastien/5a93ce324bd4b326a5e6 to your computer and use it in GitHub Desktop.
Gravity Forms - Grid Framework for gform fields
// 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