resize = function(){
                options.onResize(_api);
                _window_width = $document.width();
                $outer.attr('style','');
                _width = $outer.width();
                $fixed.css({
                    'width':_window_width==_width?'100%':_width
                });
                if(options.autoFixed){
                    var heightAuto = function(){
                        _height = $this.outerHeight();
                        $outer.css({
                            'height':_height
                        });
                    };
                    heightAuto();
                    setTimeout(heightAuto,500);
                }
            }
jquery.headroom.js 1.0
http://jquerywidget.com