Skip to content

Commit b1b1275

Browse files
committed
Added option for setting offset for autocomplete list
1 parent e572acf commit b1b1275

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
@@ -91,7 +91,8 @@
9191
showNoSuggestionNotice: false,
9292
noSuggestionNotice: 'No results',
9393
orientation: 'bottom',
94-
forceFixPosition: false
94+
forceFixPosition: false,
95+
positionOffset: [0, 0]
9596
};
9697

9798
// Shared variables:
@@ -295,7 +296,8 @@
295296
containerHeight = $container.outerHeight(),
296297
height = that.el.outerHeight(),
297298
offset = that.el.offset(),
298-
styles = { 'top': offset.top, 'left': offset.left };
299+
styles = { 'top': offset.top + that.options.positionOffset[1],
300+
'left': offset.left + that.options.positionOffset[0] };
299301

300302
if (orientation === 'auto') {
301303
var viewPortHeight = $(window).height(),

0 commit comments

Comments
 (0)