(function($) { $.fn.sbCustomSelect = function(options) { var iOS = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)), android = (navigator.userAgent.match(/Android/i)), UP = 38, DOWN = 40, SPACE = 32, RETURN = 13, TAB = 9, matchString = ''; // Sync custom display with original select box and set selected class and the correct
  • var updateSelect = function() { var $this = $(this), $dropdown = $this.siblings('.sb-dropdown'), $sbSelect = $this.siblings('.sb-select'); $sbSelect.val(this[this.selectedIndex].innerHTML); $dropdown.children().removeClass('selected') .filter(':contains(' + this[this.selectedIndex].innerHTML + ')').addClass('selected'); }; // Update original select box, hide