diff --git a/jquery.simpleselect.js b/jquery.simpleselect.js index 1b6af8f..473d93b 100644 --- a/jquery.simpleselect.js +++ b/jquery.simpleselect.js @@ -21,7 +21,8 @@ options = $.extend({}, { fadingDuration: (options && options.fadeSpeed) || 0, containerMargin: 5, - displayContainerInside: "window" + displayContainerInside: "window", + filter: ".hidden" }, options); // Loop through all selects @@ -159,7 +160,7 @@ // Populate the SimpleSelect with the select's options populateSs = function() { - this.selectOptions = this.select.find("option"); + this.selectOptions = this.select.find("option").not(this.options.filter); var ssOptionsAndOptgroups = "", addOption = function(selectOption) { ssOptionsAndOptgroups += "
"+ selectOption.text() +"
"; @@ -178,7 +179,7 @@ htmlEncode = function(html) { return html.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">"); }, - selectChildren = this.select.children("optgroup, option"), + selectChildren = this.select.children("optgroup, option").not(this.options.filter), selectHasOptgroups = false; selectChildren.each(function() { var t = $(this); @@ -473,4 +474,4 @@ }); }); -})(jQuery); \ No newline at end of file +})(jQuery);