Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ivan-kalachikov/b632f83a72a703a16dba1befe290f328 to your computer and use it in GitHub Desktop.
Save ivan-kalachikov/b632f83a72a703a16dba1befe290f328 to your computer and use it in GitHub Desktop.
//move recaptcha block to visible area
jQuery( document ).on( 'submit', '.gform_wrapper form', function() {
var n = 0;
var i = setInterval( function() {
if ( n < 20 ) {
jQuery( 'iframe[src*="recaptcha/api2/bframe"]' ).each( function( i, item ) {
var holder = jQuery( item ).parent().parent();
if ( holder.length && holder.css( 'visibility' ) == 'visible' ) {
holder.css( 'top', jQuery( window ).scrollTop() + 'px' );
clearInterval( i );
return;
}
} );
} else {
clearInterval( i );
}
n ++;
}, 500 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment