Change Opacity on ajax container

Forums › Forums › Search & Filter Pro › Change Opacity on ajax container

Viewing 6 posts – 1 through 6 (of 6 total)
  • Anonymous
    #202518

    Hello,

    How can i change opacity on ajax call on ajax container.

    Thanks

    Trevor
    #202525

    By using javascript, like this (you need to write the code to change the opacity):

    (function ( $ ) {
    	"use strict";
    	
    	$(document).on("sf:ajaxstart", ".searchandfilter", function(){
    	  // set the opacity to mainly transparent
    	});
    
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    	  // set the opacity back to normal
    	});
    
    }(jQuery));
    Anonymous
    #202537

    Hello;

    Still can’t change my opacity on sf:ajaxstart it shows 0.5 on inspecting but i want little more like 0.7
    my ajax container is: #aesearchfilter
    i used
    <script>
    (function ( $ ) {
    “use strict”;

    $(document).on(“sf:ajaxstart”, “.searchandfilter”, function(){
    // set the opacity to mainly transparent
    console.log(‘start’);
    $(“#aesearchfilter”).css(“opacity”:”0.7″);
    });

    $(document).on(“sf:ajaxfinish”, “.searchandfilter”, function(){
    // set the opacity back to normal
    console.log(‘end’);
    $(“#aesearchfilter”).css(“opacity”:”1″);
    });

    }(jQuery));
    </script>

    Trevor
    #202539

    I don’t think that is quite right:

    (function ( $ ) {
    	"use strict";
    	
    	$(document).on("sf:ajaxstart", ".searchandfilter", function(){
    	  // set the opacity to mainly transparent
    	  console.log('start');
    	  $("#aesearchfilter").css("opacity","0.7");
    	});
    
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    	  // set the opacity back to normal
    	  console.log('end');
    	  $("#aesearchfilter").css("opacity","1");
    	});
    
    }(jQuery));

    Comma between the values, not a colon? Otherwise it looks OK. Are the comments appearing in the console?

    Note that you can also use .fadeTo in jQuery.

    Edited to change the second value to use a comma.

    Anonymous
    #202548

    Hi,

    Thanks for notifying my sytax error

    I tried the script given by you, opacity 0.3 does applies for some milliseconds but it again set to default 0.5 on ajax start, i want opacity to be 0.3 on ajaxstart.

    Please have a look at attached video link

    Opacity

    Trevor
    #202550

    It looks like it is being set (probably by our javascript) and I am not sure there is any way around that. Sorry.

Viewing 6 posts – 1 through 6 (of 6 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.