Medical Pill - Page Loader with CSS

About


This is a demo page where you can check how does the "Medical Pill Page Loader" work.

The timer of the Medical Pill Page Loader is set to 3 seconds for demonstration purposes.

You can show your loader with delay, or when completing some AJAX request, page load or other.

Reload the page to see the loader again.

How to use


  1. Open the medical-pill-loader.css file.
  2. Copy the content or the file and paste into your project directory.
  3. Link the document by this code (where href="your path to the file in your project"):
  4. - if you have project folder named "Loaders" and your filename of css styles is medical-pill-loader.css, then you should have href="Loaders/medical-pill-loader.css"

    - if your medical-pill-loader.css file is stored in your desired html file folder (the file where loader will be shown) you can simply copy and paste the content from the input above: href="medical-pill-loader.css"

  5. In your HTML file you should have a div element like this:

    Where loadingDiv is the "container" class which will take care of show/hide of the pill loader and the "split-pill" class is the css styles for the pill looking loader.

  6. Finally you need some javaScript to show/hide the loader.

    This function toggles between the "activeLoader" - in other words it adds it or removes it when the function is executed. This class either shows or hides the medical pill loader.

    For example if we have some AJAX request to the server - call the showLoader() function at the beginning of your request and when finished the request - call the function showLoader() again to hide the loader.

    - For example - loadPage() loads some page info with AJAX query, then do this:

  7. Include the MIT license somewhere in your page:

    it is free for use even in commercial projects but it is cool to give credits to the author :)

  8. You are ready to use it! Enjoy!

Images


Video


License


The project is Licensed - it is free for personal and commercial use: