2009-10-07 35 views
1

我正在使用最新版本的jQuery Autocompletion插件,并且已经为800个条目填充了一个数组(作为自动完成的输入)。现在奇怪的是,当我输入一个触发大量结果的字母(导致滚动条)时,我可以在Firefox中看到滚动条,但在Internet Explorer中看不到。IE中没有出现Jquery自动完成滚动条

我只在我的JSP中包含文件jquery.autocomplete.cssjquery.autocomplete.js。我是否需要包含其他内容?

编辑:我的CSS如下:

.ac_results { 
    padding: 0px; 
    border: 1px solid black; 
    background-color: white; 
    overflow: hidden; 
    z-index: 99999; 
} 

.ac_results ul { 
    width: 100%; 
    list-style-position: outside; 
    list-style: none; 
    padding: 0; 
    margin: 0; 
} 

.ac_results li { 
    margin: 0px; 
    padding: 2px 5px; 
    cursor: default; 
    display: block; 
    /* 
    if width will be 100% horizontal scrollbar will apear 
    when scroll mode will be used 
    */ 
    /*width: 100%;*/ 
    font: menu; 
    font-size: 12px; 
    /* 
    it is very important, if line-height not setted or setted 
    in relative units scroll will be broken in firefox 
    */ 
    line-height: 16px; 
    overflow: hidden; 
} 
+0

哪个版本的IE它打破?你的网页上有其他有冲突的CSS吗?这似乎在IE8中工作正常:http://jsbin.com/ajudu – brianpeiris

+0

谢谢,我也使用IE8,并没有任何coflicting CSS。我只包含那两个指定的文件,不知道可能出了什么问题! – ernesto

+0

在mozilla中工作,也不能在eclipse内部浏览器中工作 – ernesto

回答

2

在jquery.autocomplete.js增加这一额外的支票document.body.style.maxHeight固定我的问题:

   if($.browser.msie && 
        ((typeof document.body.style.maxHeight === "undefined") || 
        (document.body.style.maxHeight == ''))) 

它是围绕线735

+0

顺便说一句,如果您设置了适当的文档类型(以便IE不进入怪癖模式),则不会出现问题: <!DOCTYPE HTML PUBLIC“ - // W3C // DTD HTML 4.01 Transitional // EN” “ http://www.w3.org/TR/html4/loose.dtd“> – guntars