0.2.6 • Published 4 years ago

el-spinner v0.2.6

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

el-spinner

Build Status npm version Greenkeeper badge

Quickly make a text spinner for your HTML. Using cli-spinners.

demo

Install

npm install --save el-spinner

Usage

Include the javascript file in your HTML and make a new ElSpinner:

<script src="/path/to/el-spinner.min.js"></script>
<span id="el"></span>
<script>
  const spinner = new ElSpinner({
    /* options */
    el: document.getElementById('el')
  })
  spinner.start() // You should manually start the spinner
</script>

You can also use it like this:

import ElSpinner from 'el-spinner'

let spinner = new ElSpinner({
  el: document.getElementById('el')
})
spinner.start()

API

methods

constructor(options)

start()

Start the spinner from the first frame.

stop()

Stop the spinner.

resume()

Resume the spinner.

toggle()

Toggle the spinner state between stop and resume.

remove()

Stop the spinner and then remove the text from the element.

set(options)

Pass a new option to the spinner.

options

OptionDescriptionTypeDefault
elThe element where to display the spinner.Element-
typeThe type of the spinner. Please check the listString'dots'
intervalInterval between each frame. If not set, the value from the original spinner will be usedNumber-
0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

6 years ago

0.0.1

6 years ago