mcDropdown plugin not working in Safari with initially hidden div

mcDropdown plugin not working in Safari with initially hidden div


The plugin mcDropdown (http://www.givainc.com/labs/
mcdropdown_jquery_plugin.htm)
will not work properly in Safari/Chrome if you place it in an
initially hidden div and later unhide it.
The reason, in the source code you will find:
        // safari will not get the correct width until after everything has
rendered
        if( $.browser.safari ){
            setTimeout(function (){
                $self
                .width($divInput.width() - $("a", $divInput).width());
            }, 100);
        }
this will return 0 width for the hidden element.
Therefor when you unhide your element, you will need to do sth like
this:
    if ($('.mcdropdown > input').width() == 0) {
        $('.mcdropdown > input').width($('.mcdropdown').width() - $
(".mcdropdown a").width());
    }
It would be nice to have a function for this inside $.mcDropDownMenu
Hope this helps someone.