Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vxsx/jquery.iswitch.js

iphonelike switch jquery plugin
https://github.com/vxsx/jquery.iswitch.js

Last synced: about 5 hours ago
JSON representation

iphonelike switch jquery plugin

Awesome Lists containing this project

README

        

#jquery.iswitch.js
Plugin that makes iphone-like checkboxes

Requires

* jquery 1.4.4 or higher
* jquery ui 1.8.9 or higher

Default options

``` javascript
labelsOutside: false
clickable : true
draggable : true
```

Using:

``` html

$('#switch').iswitch();

```
You can also set labels not only from data-attributes, but from javascript too, like

``` javascript
$('#switch').iswitch({
trueLabel: 'this is a true label',
trueColor: '#00FF00',
falseLabel: 'false label',
falseColor: 'red'
});
```
in case you set it both ways, js version have a priority

color attributes are optional, but if set, then they must be set both (you can use `transparent` anyway), see the [demo](http://vxsx.github.com/jquery.iswitch.js)

Note
-------
I just needed the iphonish switch for our company's inner project, and because none of the available on the web solutions worked for me, i did this using css3 and jquery. No, it's not crossbrowser and it's likely never be.

TODO:
-----

* tweak animation with outside labels
* rewrite all js, just too messy :D
* disabled state (really don't want this)
* need nice demo-page :)