Forums › Forums › Search & Filter Pro › How to add a loading gif?
- This topic has 4 replies, 2 voices, and was last updated 10 years, 4 months ago by Ross.
-
Ross Moderator(Private) June 11, 2014 at 10:51 am #1457
Hey Bernard
I’m going to hold fire on replying to this because I am hoping to do an update today which should help make this a bit easier..!
Will update you later on.
Thanks
Ross Moderator(Private) June 12, 2014 at 3:38 pm #1485Hey Bernard
Unfortunately this did not make the cut for todays update – right now you can’t customise what happens when loading (only content fades out) but I will be adding in JS events soon so you can detect when loading starts/stops so you can apply your own styles/loaders etc..
Does this sound like something that would work?
Then you would just do something like this in your themes JS file:
$('.searchandfilter').on('beginajax', function(){ //show custom loader }); $('.searchandfilter').on('endajax', function(){ //hide custom loader });
Ross Moderator(Private) June 24, 2014 at 1:31 pm #1851Hey Bernard, the latest update also addressed this issue, you can now hook in to two events, to find out when loading begins, and when loading finishes, so you can add any custom JS to these events to show and hide your own loader:
jQuery(".searchandfilter").on("sf:ajaxstart",function(){ //display my custom loader! alert("loading start"); }); jQuery(".searchandfilter").on("sf:ajaxfinish",function(){ //hide my custom loader! alert("loading finish"); });
-
AuthorPosts