[jQuery] Visibility

[jQuery] Visibility

Is there a simple way to implement this in jQuery?
    var selectObj                                    =    document.getElementsByTagName("select");
    if(selectObj){
        var display                                    =    (document.layers) ? "show" : "visible"; // use different if netscape
        if(st == 0){
            display                                    =    (document.layers) ? "hide" : "hidden"; // use different if netscape
        }
        for(i=0; i<selectObj.length; i++){
            if (document.layers){ // check to see if netscape
                selectObj[i].visibility             =    display;
            } else {
                selectObj[i].style.visibility        =    display;
            }
        }
    }
I need to use visibility since hide() and show() use display: block and
display: none and shrink the areas where the selects used to be
creating a very unfriendly form.
I tried this:
        if(st == 0){
                $('select').css('visibility', 'hide');
        } else {
                $('select').css('visibility', 'show');
        }
and got javascript errors.
Any ideas?
On a side note: I noticed a bug when using:
  - show() and hide()
  - fadeIn() and fadeOut()
the initial state of the UL within a DIV is hidden, so when I click to
show() the UL it comes up successfully, but when I click to hide () the
UL and then click once more to show() it starts putting in extra
padding space at the bottom, making the div that holds the UL start
expanding expodentially. And in the case of selects that are shown
after they were hidden, it sets the height of them to a large value
creating ugly looking selects, (the selects look like multi-selects).
Same issue with the fadeIn and fadeOut the padding space at the bottom
grows expodentially.
Any ideas?
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/