Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hirejordansmith/4c216f8fc30b0cce9efb12bc09fec04b to your computer and use it in GitHub Desktop.

Select an option

Save hirejordansmith/4c216f8fc30b0cce9efb12bc09fec04b to your computer and use it in GitHub Desktop.
Replace AJAX Spinner with Custom Spinner
/*
hourglass.gif replaces the default AJAX spinner
http://loading.io/ <- Good place to find a new one
*/
body img.gform_ajax_spinner {
position: fixed !important;
z-index: 999999;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: block !important;
overflow: hidden !important;
width: 100% !important;
height: 100% !important;
background-color: rgba(255, 255, 255); /* fall back */
background-color: rgba(255, 255, 255, 0.7);
background-image: url('images/hourglass.gif'); /* path to your new spinner */
background-repeat: no-repeat;
background-size: 194px 194px;
background-position: center center;
}
<?php
// Make sure to create a transparent images 1 x 1 and upload to themes images folder
add_filter("gform_ajax_spinner_url", "spinner_url", 10, 2);
function spinner_url($image_src, $form){
return get_stylesheet_directory_uri() . '/images/one-pixel.png' ; // relative to you theme images folder
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment