jQuery(function($){ $.fn.shop_select_to_html = function(option) { var defaults = { menu_down_icon : '' } if (typeof option == 'string') { } else if(typeof option == 'object'){ defaults = $.extend({}, defaults, option); } // Hide native select this.hide(); this.each(function() { var $select = $(this); if (!$select.next().hasClass('shop_select_to_html')) { create_html_select($select); } }); function create_html_select($select) { $select.after($('
') .addClass('shop_select_to_html') .addClass($select.attr('class') || '') .addClass($select.attr('disabled') ? 'disabled' : '') // .attr('tabindex', $select.attr('disabled') ? null : '0') .html('') ); var $dropdown = $select.next(), $options = $select.find('option'), $selected = $select.find('option:selected'), list_next_num = 8, menuhtmls = []; $dropdown.find('.current').html($selected.data('display') || $selected.text()+defaults.menu_down_icon); var $ul_el = $('