简体   繁体   English

自动填充列表固定位置浏览器调整大小

[英]Autocomplete List Fixed Position Browser Resize

I am using MVC 5 with Twitter bootstrap. 我正在使用MVC 5和Twitter bootstrap。 Recently implemented an autocomplete for a list of Cities. 最近实施了城市列表的自动填充。 The problem is that if I resize the window while the autocomplete list is shown it remains in a fixed position instead of being below the input text field. 问题是,如果在显示自动完成列表时调整窗口大小,它将保持固定位置而不是在输入文本字段下方。

Example on this link 此链接上的示例

Here 这里

Image Result 图像结果

You could include javascript to detect the browser resize and close the Autocomplete box when that event is triggered: 您可以包含javascript来检测浏览器调整大小并在触发该事件时关闭“自动完成”框:

$(window).resize(function() {
   $("#myAutoComplete").autocomplete("close");
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM