//В IE и opera optgroup и option не скрываются стандартным jquery hide или css display:none
- $.fn.hideOptgroup = function() {
- this.each(function() {
- if ($(this).is('optgroup') && (!$(this).parent().is('span'))) {
- $(this).wrap('<span>').hide();
- }
- });
- };
- $.fn.showOptgroup = function() {
- this.each(function() {
- if (this.nodeName.toLowerCase() === 'optgroup') {
- var p = $(this).parent(),
- o = this;
- $(o).show();
- $(p).replaceWith(o);
- } else {
- var opt = $('optgroup', $(this));
- $(this).replaceWith(opt);
- opt.show();
- }
- });
- };
http://work.arounds.org/issue/96/option-elements-do-not-hide-in-IE/