更改jQuery UI的自动完成位置 - 弹出,而不是下降 [英] Change jQuery UI Autocomplete Position - Pop up, instead of down
本文介绍了更改jQuery UI的自动完成位置 - 弹出,而不是下降的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我把一个自动完成框在我页的底部,我想结果弹出OVER文本框,而不是下面。我怎样才能做到这一点?
I am placing an autocomplete box at the bottom of my page and I would like the results to pop up OVER the text box, instead of below. How can I do this?
推荐答案
好像我已经能够已经回答我的问题。我打开一个更好的解决方案,如果某人得到了它。我已将此添加到自动完成启动..它本质上重新定位打开包装盒到一个新的偏移量。
Seems as if I've been able to answer my own question already. I'm open to a better solution if someones got it. I added this to the autocomplete start up.. essentially it repositions the box on open to a new offset.
open: function(event, ui) {
var autocomplete = $(".ui-autocomplete");
var oldTop = autocomplete.offset().top;
var newTop = oldTop - autocomplete.height() - $("#quick_add").height() - 10;
autocomplete.css("top", newTop);
}
这篇关于更改jQuery UI的自动完成位置 - 弹出,而不是下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文