From aa4f4fb091b398ec1720f9eca8875ab9507e4884 Mon Sep 17 00:00:00 2001 From: dimadietto Date: Wed, 12 Feb 2014 01:48:54 -0800 Subject: [PATCH] Custom pinTo element Add custom element to pin suggestion box --- src/jquery.autocomplete.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index f2114bf..9cee6e0 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -59,6 +59,7 @@ lookup: null, onSelect: null, width: 'auto', + pinTo: el, minChars: 1, maxHeight: 300, deferRequestBy: 0, @@ -253,7 +254,7 @@ return; } - offset = that.el.offset(); + offset = $(that.options.pinTo).offset(); styles = { top: (offset.top + that.el.outerHeight()) + 'px',