Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sasha240100/circlespinjs
Mouse spinning jquery plugin.
https://github.com/sasha240100/circlespinjs
Last synced: about 1 month ago
JSON representation
Mouse spinning jquery plugin.
- Host: GitHub
- URL: https://github.com/sasha240100/circlespinjs
- Owner: sasha240100
- Created: 2015-05-03T22:03:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-03T22:51:15.000Z (over 9 years ago)
- Last Synced: 2024-10-12T23:54:28.141Z (3 months ago)
- Language: JavaScript
- Size: 313 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# circlespinjs
Mouse spinning jquery plugin.Working example: http://sitepro.ga/circlespinjs/
# Installation
Basic installation example:```javascript
var spin = $('#spin').circlespin();
```Example with added rotation and refreshing on resize event:
```javascript
var spin = $('#spin').circlespin({preangle: 51.5, autoupdate: true}).setAngle(51.5);```
### Options
Put an options object in *circlespin()* function argument+ **width** - width of spinning element **(defines automaticly)**
+ **height** - height of spinning element **(defines automaticly)**
+ **left** - x of spinning element **(defines automaticly)**
+ **top** - y of spinning element **(defines automaticly)**
+ **preangle** - adding start angle **(deafult: 0)**
+ **autoupdate** - resize update **(deafult: false)**### Events
+ **spinning** - spinning event (when user is rotating object)
+ **spinstart** - spinning start event
+ **spinend** - spinning end event```javascript
$('#spin').on('spinstart', function() {
console.log('You started spinning this object!');
});
```### Methods
If you need to get angle or specific number when something happens, you can use this methods
```javascript
spin.getResult(300,1000).toFixed() // I use toFixed() to make it integer. will return number from 300 to 1000 (depends of angle)
```
One more returning method.```javascript
spin.getAngle() // returns angle in degrees
```Setting new angle.
```javascript
spin.setAngle(90) // will set 90 degrees in angle
```Updating object settings.
```javascript
spin.updateSettings({
width: 50,
height: 30,
left: 20,
top: 10,
preangle: 90
}); //will update settings.
```## Changelog
+ **verson 1.0** *(all is stable. basic features.)*