Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/spin
Higher level spinner api built on component/spinner - positions and scales automatically within target element
https://github.com/component/spin
Last synced: 30 days ago
JSON representation
Higher level spinner api built on component/spinner - positions and scales automatically within target element
- Host: GitHub
- URL: https://github.com/component/spin
- Owner: component
- Created: 2013-02-26T21:59:41.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-19T23:25:15.000Z (almost 10 years ago)
- Last Synced: 2024-05-08T17:06:52.948Z (8 months ago)
- Language: JavaScript
- Size: 147 KB
- Stars: 21
- Watchers: 15
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# spin
Higher level spinner API auto positioning and scaling
to fit within the target element. Built on [component/spinner](https://github.com/component/spinner).![javascript spinner](http://i.cloudup.com/7F5SguoUkoB+e4r.png)
## Installation
$ component install component/spin
## API
### spin(el, [options])
Add a spinner to `el` with options, and return
the `Spinner` instance.- `size` defaulting to 1/5th the element width
- `delay` default to 300ms```js
var s = spin(document.querySelector('.one'));
```### Spinner#update()
Augments the `Spinner` returned with an `.update()` method,
which updates the size and position of the spinner.### Spinner#remove()
Augments the `Spinner` returned with a `.remove()` method,
which when removes the spinner or cancels delayed spinners.## License
MIT