!function ($) { "use strict"; $.fn['switch'] = function (method) { var inputSelector = 'input[type!="hidden"]'; var methods = { init: function () { return this.each(function () { var $element = $(this) , $div , $switchLeft , $switchRight , $label , $form = $element.closest('form') , myClasses = "" , classes = $element.attr('class') , color , moving , onLabel = "On" , offLabel = "Off" , icon = false , textLabel = false; $element.addClass('switch'); if ($element.data('on') !== undefined) color = "switch-" + $element.data('on'); if ($element.data('on-label') !== undefined) onLabel = $element.data('on-label'); if ($element.data('off-label') !== undefined) offLabel = $element.data('off-label'); if ($element.data('label-icon') !== undefined) icon = $element.data('label-icon'); if ($element.data('text-label') !== undefined) textLabel = $element.data('text-label'); $switchLeft = $('') .addClass("switch-left") .addClass(myClasses) .addClass(color) .html('' + onLabel + ''); color = ''; if ($element.data('off') !== undefined) color = "switch-" + $element.data('off'); $switchRight = $('') .addClass("switch-right") .addClass(myClasses) .addClass(color) .html('' + offLabel + ''); $label = $('