PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Change the spinner image & show it above a semi-transparent layer

  1. Lea Cohen
    Member

    Is it possible to replace the spinner image with out own custom image?

    And also - is it possible to make it appear as if its above a semi-transparent layer on the form?

    This is an image of what I'm trying to achieve

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  2. I don't know if this helps you...

    You can put this in your style.css with the relavant path to your new spinner.gif

    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(0, 0, 0); /* fall back */
    	background-color: rgba(0, 0, 0, 0.7);
    	background-image: url('images/preloading.gif');  /* path to your new spinner */
    	background-repeat: no-repeat;
    	background-size: 60px 60px;
    	background-position: center center;
    }

    And then you have to replace the spinner.gif with a transparent 1px x 1px gif - but replace spinner.gif with the same file name.

    This is located in your images folder in the gravity form plugins folder.

    I have not tested it in all browsers and I'm not sure if it recommended to change the current spinner.gif incase it's used in the admin or else where. Plus if you do an update you will have to remember to replace it again with a transparent gif.

    I'm sure someone could write some jQuery to edit the attribute of the spinner img to a blank.gif in your theme images folder.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  3. Lea Cohen
    Member

    Thanks, Josh, but you're right that changing the image in the gravity forms plugin folder is what seems problematic to me. I want to know if there is a way to tell the form to use an image from a different folder.

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  4. OK, if you put this in your theme functions...

    add_filter("gform_ajax_spinner_url", "spinner_url", 10, 2);
    function spinner_url($image_src, $form){
        return  get_bloginfo('template_directory') . '/images/blank.gif' ; // relative to you theme images folder
    }

    or if it specifically for form ID 6, add the ID number after gform_ajax_spinner_url like this...

    add_filter("gform_ajax_spinner_url_6", "spinner_url", 10, 2);
    function spinner_url($image_src, $form){
        return  get_bloginfo('template_directory') . '/images/blank.gif' ;
    }

    And then if you use my original css in your style.css ( in my example below I have specified my class to form ID 6).

    #gform_wrapper_6 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(0, 0, 0); /* fall back */
        background-color: rgba(0, 0, 0, 0.7);
        background-image: url('images/preloading.gif');  /* path to your new spinner */
        background-repeat: no-repeat;
        background-size: 60px 60px;
        background-position: center center;
    }

    Give it ago but otherwise see what the experts can suggest.

    See documentation here.
    http://www.gravityhelp.com/documentation/page/Gform_ajax_spinner_url

    Posted 12 years ago on Thursday July 19, 2012 | Permalink
  5. Lea Cohen
    Member

    Again thank you very much Josh!

    Actually, I didn't need it in a fixed position, because it doesn't need to cover the whole screen (sorry that the image was misleading), but only the form.
    In order to do that, I changed it to position absolute, but the problem was that my .gform_footer has position relative for other reasons, so this couldn't work. But otherwise, it was an excellent solution, and I learned how to change the image if I ever need it, so I really appreciate your help :)

    Posted 12 years ago on Thursday September 6, 2012 | Permalink
  6. Thanks for the update @leac.

    Posted 12 years ago on Thursday September 6, 2012 | Permalink