# vewe-switch-plugin

> Simple JQuery switch plugin for Bootstrap 4

Latest version **1.0.2** (published 2019-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vewe-switch-plugin
pnpm add vewe-switch-plugin
yarn add vewe-switch-plugin
bun add vewe-switch-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-09-16 |
| First published | 2019-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 186.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Javi |
| Maintainers | voicingewe |
| Keywords | bootstrap, jquery, switch |

## Links

- npm: https://www.npmjs.com/package/vewe-switch-plugin
- Homepage: https://github.com/voicingewe/vewe-switch-plugin
- Issues: https://github.com/voicingewe/veweSwitch/issues
- npm.io page: https://npm.io/package/vewe-switch-plugin

## Dependencies (2)

- [jquery](https://npm.io/package/jquery.md) >=3.4.1
- [bootstrap](https://npm.io/package/bootstrap.md) >=4.3.1

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-09-16
- 1.0.1 — 2019-09-16

## README

# jQuery Switch Plugin
# Warning
## Forked from [Hurkan-Switch](https://github.com/hurkanaras/Hurkan-Switch-Plugin)
    This is a simple responsive jquery plugin meant to allow switch 
    based interactions with flexible configuration options and event 
    hooks. It was forked to update Hurkan-Switch-Plugin to Bootstrap 4 
    and JQuery 3 as well as have an npm updatable plugin. Apart from the 
    initial updates, it is considered for me a step to update the 
    outdated Hurkan-Switch-Plugin to Bootstrap 4 and JQuery 3 and later 
    replace it with a better maintained plugin.
---
## Contact
---
Javi: voicingewe@gmail.com

# Example I
---
```html
<div id="demo">
	<input name="demo" />
</div>
```
```javascript
 var options = {
	'onTitle':'ON',
	'offTitle':'OFF',
	'onColor':'success’, '//danger,success,info,primary,default,warning
	'offColor':'danger', '// danger,success,info,primary,default,warning
	'animate':true, //or false
	'responsive':false,  '//or true 
	'checked':'your value', '// default input checked value="your value" OR checked:'.input-selector'
	'selected':function(input,status){ '// input selector event 
	 $(input)
	  status ==> on / off - String
		console.log(status);
	},
	 'offConfirm':function(input){ 
		if(confirm("Are you sure?")){
			$(input).trigger("click",true);
		}

		return false;
	  },
	 'onConfirm':function(input) {
		if(confirm("Are you sure?")) {
			$(input).trigger("click",true);
		}

		return false;
	},

};

$('#demo').veweSwitch(options);
```
 
# Example II
---
```html
<div id="demo2">
	<input data-title="On" data-on-color="success"  value="your value 1"  data-on="true" name="demo3" type="radio" />
	<input data-title="Off" data-off-color="success" value="your value 2" data-off="true" name="demo3" type="radio" />
</div>
```
```javascript
$('#demo2').veweSwitch({
	'checked':'your value 2'
});
```

---
_Source: https://npm.io/package/vewe-switch-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
