0

Is there a way of having the fake loader reload on every button click without it waiting for page reload

     <div id="fakeLoader"></div>

    <script type="text/javascript">
      $("#fakeloader").fakeLoader({   timeToHide:1200, //Time in milliseconds for fakeLoader disappear
       zIndex:"999",//Default zIndex 
        spinner:"spinner1",//Options: 'spinner1', 'spinner2', 'spinner3', 'spinner4', 'spinner5', 'spinner6', 'spinner7'
        bgColor:"#2ecc71", //Hex, RGB or RGBA colors
        imagePath:"yourPath/customizedImage.gif" //If you want can you insert your custom image

      });

   </script>
Esko
  • 4,109
  • 2
  • 22
  • 37
Prince
  • 43
  • 9

1 Answers1

0

You don't need to unload it as such. It does that by itself after timeToHide ms has passed.

You can also bind events to trigger the fakeLoader. The example below will trigger the fakeLoader on every single click on an <a...> link, but you can bind it to any event:

$(document).on('click', 'a', function(e) {
      $("#fakeloader").fakeLoader({   timeToHide:1200, //Time in milliseconds for fakeLoader disappear
       zIndex:"999",//Default zIndex 
        spinner:"spinner1",//Options: 'spinner1', 'spinner2', 'spinner3', 'spinner4', 'spinner5', 'spinner6', 'spinner7'
        bgColor:"#2ecc71", //Hex, RGB or RGBA colors
        imagePath:"yourPath/customizedImage.gif" //If you want can you insert your custom image

      });
});
dearsina
  • 4,774
  • 2
  • 28
  • 34