ludo.form.OnOff

ludo.form.


new ludo.form.OnOff(config)

Displays a customizable On/Off Switch.

For a demo, see form-components.php

Parameters:
Name Type Description
config Object
Properties
Name Type Description
trackBorderWidth Number

Border width of tracks in pixels. Default: 1

textSizeRatio Number

Text size ratio. Default: 0.45

trackColorOn String

Track color ON. Default: #F57C00

trackColorOff String

Track color OFF. Default: #666666

textColorOn String

Text Color ON. Default: decided by theme CSS

textColorOff String

Text Color OFF. Default: #FFFFFF

textOn String

Text On. Default: empty string

textOff String

Text Off. Default: empty string

valOn String | Number

Value when checked. Default: "1"

valOff String | Number

Value when unchecked. Default: ""(empty string)

checked Boolean

True to make the switch initial checked.

Source:

Methods


val(val) → {*}

Set or get value

Parameters:
Name Type Description
val
Source:
Returns:
Type
*