Skip to content

Instantly share code, notes, and snippets.

@kevanmoothien
Last active February 11, 2017 18:29
Show Gist options
  • Save kevanmoothien/cf9904e7825a29b5d92513ba475f6f65 to your computer and use it in GitHub Desktop.
Save kevanmoothien/cf9904e7825a29b5d92513ba475f6f65 to your computer and use it in GitHub Desktop.

Installation

Click on the link below and add the codes in a visualforce component name "spinner" or any other name that sound best for you

https://raw.githubusercontent.com/kevanmoothien/sfdc-spinner/master/src/components/spinner.component

Basic usage

Include the Visualforce component on the Visualforce page you want to use the spinner/loading like in the code below.

<apex:page>
  <c:spinner />
</apex:page>
Displaying the spinner

To display the spinner, a JavaScript code must be executed. Here are the code

km_spin(true); // to show the spinner
km_spin(false); // to hide the spinner

Advanced usage

Customizing the spinner

You can further customize the Spinner by adding some attributes such as in the code below:

<apex:page>
    <c:spinner spinner_name="wave"  spinner_color="red" />
</apex:page>

Possible value for "spinner_name" are:

  • rotating-plane
  • wave
  • wandering-cubes
  • spinner-pulse
  • double-bounce
  • chasing-dots
  • three-bounce
  • circle
  • cube-grid
  • fading-circle
  • folding-cube

Value for "spinner_color" is a hex or html color name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment