Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
UISwitch module for sioux
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
README.md
index.js
package.json
struct.html
style.css

README.md

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);

Something went wrong with that request. Please try again.