Skip to content

Commit a6dfb9e

Browse files
johannesdThomas Wanschik
authored andcommitted
Added option for setting offset for autocomplete list
1 parent 59a1293 commit a6dfb9e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/jquery.autocomplete.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
showNoSuggestionNotice: false,
123123
noSuggestionNotice: 'No results',
124124
orientation: 'bottom',
125-
forceFixPosition: false
125+
forceFixPosition: false,
126+
positionOffset: [0, 0]
126127
};
127128

128129
function _lookupFilter(suggestion, originalQuery, queryLowerCase) {
@@ -308,7 +309,8 @@
308309
containerHeight = $container.outerHeight(),
309310
height = that.el.outerHeight(),
310311
offset = that.el.offset(),
311-
styles = { 'top': offset.top, 'left': offset.left };
312+
styles = { 'top': offset.top + that.options.positionOffset[1],
313+
'left': offset.left + that.options.positionOffset[0] };
312314

313315
if (orientation === 'auto') {
314316
var viewPortHeight = $(window).height(),

0 commit comments

Comments
 (0)