Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ defaults = {
};
```

- `size` : size of switch element, can be `default` | `small` | `large`
- `checked` : state of switch and checbox, if `undefined` the switch state according to the checkbox
- `size` : the size of a switch element, can be default | small | large
- `checked` : state of switch and checkbox, if undefined the switch state according to the checkbox
- `onText` : text in the jack when switch ON
- `offText` : text in the jack when switch OFF
- `onSwitchColor` : color of checked switch element
Expand Down
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,13 @@ <h4 class="demo-box-title">color</h4>
<input type="checkbox" class="demo-color-1" />
</div>
</div>

<div class="demo-box">
<h4 class="demo-box-title">Predefined Classes</h4>
<div class="demo-box-content">
<pre>
<code>

&lt;input type="checkbox" class="switch-primary" /&gt;<br>
&lt;input type="checkbox" class="switch-success" /&gt;<br>
&lt;input type="checkbox" class="switch-danger" /&gt;<br>
Expand Down Expand Up @@ -296,6 +297,7 @@ <h4 class="demo-box-title">remove</h4>
};

Object.keys(switchConfig).forEach(function (key) {
console.log(document.querySelector('.' + key));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to log the element here?

switches[key] = new Switch(document.querySelector('.' + key),switchConfig[key]);
});

Expand Down