Beautiful switches that look like iOS 7-9 switches.
- new switch size: mini
- rewritten JS file, now with a real
var awesomeness = new Switch8("#elem")instead of the existing fake one - HTML attributes were nice while they lasted (they're going away, so don't worry you can still get version 2.7)
- a kinder message (in the console) when an element already has .switch8
| Switch8 | iOS 8 |
|---|---|
![]() |
![]() |
They are not the same picture. There is a difference between the two pictures. I wanted to make that extremely clear.
Getting started is super easy: pick a method that you like and copy the code!
<link rel="stylesheet" href="http://theawesomecoder61.github.io/Switch8/switch8.css">
<script src="http://theawesomecoder61.github.io/Switch8/switch8.js"></script>
Note! The links above are hosted on this website, so sometimes they may be slow.
<link rel="stylesheet" href="path/to/switch8.css">
<script src="path/to/switch8.js"></script>
Obviously, replace path/to/ with the path to the files. Rember ../* allows you to go back a folder.
Check out the official pen for the demos.
Defines the element
If it's true, you can use HTML attributes to customize the switch
Sets the switch's state
Prevents user from toggling the switch
Changes the color of the checked state
Changes the color of the unchecked state
Changes the color of the checked state
Changes the color of the unchecked state
Make the switch size smaller
Based off of this article.
iOS is a registered trademark of Apple Inc. All rights reserved. Switch8 or theawesomecoder61 are not affiliated with iOS or Apple Inc.

