0.0.8 • Published 11 years ago

sioux-ui-switch v0.0.8

Weekly downloads
38
License
-
Repository
github
Last release
11 years ago

Sioux UISwitch

Overview

The UISwitch class lets you create On/Off buttons, similar to the iOS one. demo

Inheriths from:

  • sioux-ui

javascript:

var UISwitch = require('sioux-ui-switch');
var uiswitch = new UISwitch(document.querySelector('.container'));
// document.querySelector('.container') is the element in which the switch will be appended

uiswitch
.on('tap', function (event) {
  console.log('Tapped!');
})
.on('change', function (event, state) {
  console.log('State: ' + state);
})
;

Properties

state

  • Boolean
  • the state of the switch

Methods

setState(state)

Sets the switch to the passed in state (Boolean).

Events

'change'

Fires when the switch changed state (when the CSS transition ends);

0.0.8

11 years ago

0.0.7

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago