Animation rotation via scroll, mouse and touch events
- Horizontal or vertical orientation
- Touch events support
- Scroll support
- Reverse and cyclic rotation
npm install --save circlr
import circlr from 'circlr';
const el = document.querySelector('.container');
circlr(el)
.scroll(true)
.play()
.on('show', n => {
});
Create rotation instance.
Type: string
, element
Element.
Type: boolean
Rotation via scroll flag.
Type: boolean
Vertical orientation flag.
Type: boolean
Reverse rotation flag.
Type: boolean
Cyclic rotation flag, default true
.
Type: number
Start frame, default 0
.
Type: number
Playback interval, default 75
ms.
Start sequence playback.
Type: number
Frame number for playback to him or infinity playback if number in not specified.
Stop playback.
Show specified frame.
Type: number
Frame number.
Show previous frame.
Show next frame.
Unbind rotation events.
show
, when frame is showed
- Internet Explorer 9+
- Chrome
- Safari
- Firefox
- Opera
- react-rotation - react rotation component
MIT