Skip to content

Instantly share code, notes, and snippets.

@dexit
Forked from offroadkev/functions.php
Created May 21, 2021 11:08
Show Gist options
  • Select an option

  • Save dexit/7592c5803e5d79d025cb7ad1e8ee8c84 to your computer and use it in GitHub Desktop.

Select an option

Save dexit/7592c5803e5d79d025cb7ad1e8ee8c84 to your computer and use it in GitHub Desktop.
Change Gravity Forms Spinner to CSS Spinner
// Changes Gravity Forms Ajax Spinner (next, back, submit) to a transparent image
// this allows you to target the css and create a pure css spinner like the one used below in the style.css file of this gist.
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; // relative to you theme images folder
}
/* Spinner */
.gform_ajax_spinner {
margin-left: 20px;
border: 4px solid rgba(255, 255, 255, 0.3);
border-left: 4px solid rgba(110, 73, 217, 0.7);
animation: spinner 1.1s infinite linear;
border-radius: 50%;
width: 30px;
height: 30px;
}
@keyframes spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@dexit
Copy link
Author

dexit commented May 21, 2021

/* Spinner */
.gform_ajax_spinner {
content:'';
margin-left: 20px;
border: 4px solid #CA9231!important;
border-left: 4px solid #0000006e!important;
animation: spinner 1.1s infinite linear;
border-radius: 50%!important;
width: 30px;
height: 30px!important;
background: transparent;

}
@Keyframes spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment