/** * jQuery switchbutton * * Based on work by tdreyno on iphone-style-checkboxes for events management * (https://github.com/tdreyno/iphone-style-checkboxes) * * Copyright 2011, L.STEVENIN * Released under the MIT license. */ .ui-switchbutton { display: inline-block; padding: 0; position: relative; overflow: hidden; cursor: pointer; user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; } .ui-switchbutton input { display: none; } .ui-switchbutton label { white-space: nowrap; cursor: pointer; display: block; position: absolute; top: 0; width: auto; overflow: hidden; user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; } .ui-switchbutton label.ui-switchbutton-disabled { right: 0; text-align: right; text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6); } .ui-switchbutton label.ui-switchbutton-disabled span { display: inline-block; text-align: center; padding-left: 2px; padding-right: 3px; } .ui-switchbutton.ui-switchbutton-no-labels label span { width: 1em; } .ui-switchbutton label.ui-switchbutton-enabled { left: 0; text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6); } .ui-switchbutton label.ui-switchbutton-enabled span { display: inline-block; text-align: center; padding-left: 3px; padding-right: 2px; } .ui-switchbutton .ui-switchbutton-handle { display: block; width: 0; position: absolute; top: 0; left: 0; cursor: pointer; } .ui-switchbutton.ui-switchbutton-disabled { opacity: 0.4; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); filter: Alpha(Opacity=40); cursor: default; } .ui-switchbutton.ui-switchbutton-disabled label, .ui-switchbutton.ui-switchbutton-disabled .ui-switchbutton-handle { cursor: default; } /** * STYLES * * Styles are composed by a default style which can be overrided by specific classed passed in argument */ /* Default style */ .ui-switchbutton-default { height: 24px; } .ui-switchbutton-default label { font-size: 14px; line-height: 18px; font-weight: bold; font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; text-transform: uppercase; height: 20px; padding-top: 4px; } .ui-switchbutton-default label.ui-switchbutton-disabled { color: #8b8b8b; background: #e2e2e2; /* Old browsers */ background: -moz-linear-gradient(top, #7c7c7c 0%, #c5c4c5 25%, #e2e2e2 50%, #efefef 75%, #f8f8f8 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#7c7c7c), color-stop(25%,#c5c4c5), color-stop(50%,#e2e2e2), color-stop(75%,#efefef), color-stop(100%,#f8f8f8)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #7c7c7c 0%,#c5c4c5 25%,#e2e2e2 50%,#efefef 75%,#f8f8f8 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #7c7c7c 0%,#c5c4c5 25%,#e2e2e2 50%,#efefef 75%,#f8f8f8 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, #7c7c7c 0%,#c5c4c5 25%,#e2e2e2 50%,#efefef 75%,#f8f8f8 100%); /* IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7c7c7c', endColorstr='#f8f8f8',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, #7c7c7c 0%,#c5c4c5 25%,#e2e2e2 50%,#efefef 75%,#f8f8f8 100%); /* W3C */ box-shadow: inset 0px 0px 1px rgba(0, 0, 0, 0.5); -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .ui-switchbutton-default label.ui-switchbutton-enabled { color: white; background: #488fe4; /* Old browsers */ background: -moz-linear-gradient(top, #2f63a0 0%, #488fe4 25%, #569aef 49%, #5d9ff2 51%, #77aff8 75%, #86b6f4 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2f63a0), color-stop(25%,#488fe4), color-stop(49%,#569aef), color-stop(51%,#5d9ff2), color-stop(75%,#77aff8), color-stop(100%,#86b6f4)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #2f63a0 0%,#488fe4 25%,#569aef 49%,#5d9ff2 51%,#77aff8 75%,#86b6f4 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #2f63a0 0%,#488fe4 25%,#569aef 49%,#5d9ff2 51%,#77aff8 75%,#86b6f4 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, #2f63a0 0%,#488fe4 25%,#569aef 49%,#5d9ff2 51%,#77aff8 75%,#86b6f4 100%); /* IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2f63a0', endColorstr='#86b6f4',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, #2f63a0 0%,#488fe4 25%,#569aef 49%,#5d9ff2 51%,#77aff8 75%,#86b6f4 100%); /* W3C */ box-shadow: inset 0px 0px 1px rgba(0, 0, 0, 0.7); -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; padding-right: 4px; } .ui-switchbutton-default .ui-switchbutton-handle { height: 22px; background: #f2f2f2; /* Old browsers */ background: -moz-linear-gradient(top, #d7d7d7 0%, #fcfcfc 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d7d7d7), color-stop(100%,#fcfcfc)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #d7d7d7 0%,#fcfcfc 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #d7d7d7 0%,#fcfcfc 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, #d7d7d7 0%,#fcfcfc 100%); /* IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d7d7d7', endColorstr='#fcfcfc',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, #d7d7d7 0%,#fcfcfc 100%); /* W3C */ box-shadow: inset 0px 0px 2px rgba(255, 255, 255, 1); border: 1px solid #a2a2a2; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } /* Thin style */ .ui-switchbutton-thin { height: 20px; } .ui-switchbutton-thin label { font-size: 13px; line-height: 16px; height: 18px; padding-top: 2px; } .ui-switchbutton-thin .ui-switchbutton-handle { height: 18px; } /* iso5 style */ .ui-switchbutton-ios5 label.ui-switchbutton-disabled { -webkit-border-radius: 12px; -moz-border-radius: 12px; border-radius: 12px; } .ui-switchbutton-ios5 label.ui-switchbutton-enabled { -webkit-border-radius: 12px; -moz-border-radius: 12px; border-radius: 12px; -webkit-border-top-right-radius: 0px; -moz-border-radius-topright: 0px; border-top-right-radius: 0px; -webkit-border-bottom-right-radius: 0px; -moz-border-radius-bottomright: 0px; border-bottom-right-radius: 0px; } .ui-switchbutton-ios5 label.ui-switchbutton-enabled { padding-right: 0px; } .ui-switchbutton-ios5.ui-state-active label.ui-switchbutton-enabled { padding-right: 10px; } .ui-switchbutton-ios5 .ui-switchbutton-handle { height: 22px; width: 22px !important; -webkit-border-radius: 12px; -moz-border-radius: 12px; border-radius: 12px; } /* Force sizes */ /* .ui-switchbutton { width: 50px; } .ui-switchbutton .ui-switchbutton-handle { width: 20px; } */