---
title: "解决：jquery.autocomplete在IE6下被下拉框遮住的问题 "
author: "Samter"
date: "2010-11-30T22:18:17Z"
tags: []
categories: ["Web前端"]
slug: "jquery-autocomplete-ie6"
draft: false
lastmod: "2010-11-30T22:18:17Z"
id: 829772
url: "https://samter.iteye.com/blog/829772"
---

最近遇到一个很纠结的问题：**jquery.autocomplete在IE6下被下拉框遮挡 。**

 

**如图：**

 

![](http://dl.iteye.com/upload/attachment/357551/cb75cf78-dfad-3230-af1f-77bfd0a92fd5.jpg)

 

网上找到原因，例如：http://www.360doc.com/content/10/1126/16/2197500\_72641076.shtml

 

但是，我们的问题是我们用了jquery.autocomplete这个控件，这些方法对于我们就不行了。

 

**废话多了，直接解决方法：**

 

**第一步：**打开jquery.autocomplete.min.js（或者直接jquery.autocomplete.js），找到“function init()”，把这个函数下的“element=$("&lt;div/&gt;")”修改为“element=$("&lt;div&gt;&lt;iframe style='position: absolute; z-index: -1; width: 100%; height: 100%; top: 0;left: 0; scrolling: no;' frameborder='0' src='about:blank'&gt;&lt;/iframe&gt;&lt;/div&gt;")”。

 

**第二步：**打开“jquery.autocomplete.css”，在“.ac\_results”加一句“height:335px;”，就是设置高度，这个随便你设置。

 

**刷新，如下图：**

 

![](http://dl.iteye.com/upload/attachment/357553/6c1aa6a2-a628-3f1d-8e83-2bcd586fde95.jpg)

 

 

至此，问题解决。