diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 5f7db57..af3b920 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -258,12 +258,12 @@ offset = that.el.offset(); styles = { - top: (offset.top + that.el.outerHeight()) + 'px', left: offset.left + 'px' }; - - if(!!that.options.openOnTop){ - styles.top = $(document).height() - offset.top + 'px'; + if(!that.options.openOnTop){ + styles.top = (offset.top + that.el.outerHeight()) + 'px' + }else{ + styles.bottom = ($(document).height() - offset.top) + 'px'; } if (that.options.width === 'auto') {