From 5707c9f2bf48525a0efe4ec884c3edda27261ddb Mon Sep 17 00:00:00 2001 From: jiangbaojun Date: Tue, 20 Mar 2018 11:30:55 +0800 Subject: [PATCH] add css 'right' option,working when 'width' option value equal 'auto' --- src/jquery.autocomplete.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 173ac5e..b331d06 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -347,7 +347,11 @@ if (that.options.width === 'auto') { styles.width = that.el.outerWidth() + 'px'; } - + // add css "right" option,working when "width" option value equal "auto" + if(that.options.right && that.options.width === 'auto'){ + styles.width = ""; + styles.right = that.options.right+"px"; + } $container.css(styles); },