IE6:在 jQuery 选项卡内选择不会呈现下拉列表
我在 jQuery 选项卡中有一个表单;我以简单的方式创建选项卡:
$("#tabs").tabs({selected: 1});
所选索引 1 是放置表单的选项卡。问题是,在使用 IE6 的远程计算机上,单击下拉箭头时,两者都选择仅显示一个小空行,而不是包含选项的列表:
不正确的下拉列表 http://queen3.at.tut.by/DropDownIE6jQuery.PNG
这些选项位于页面源代码中,并且所有内容实际上都可以在其他计算机、其他浏览器以及 IE6 中运行(虽然我使用IETester)。
一切都会正常工作
- 如果我删除选项卡创建,即 .tabs() - 选项确实会出现并工作,那么 ;或者
- 首先选择没有表单的选项卡(选项卡 0),然后单击它 - 选项确实出现并起作用
- 仅在点击时;创建选项卡后的编程 .tabs("select", 1) 没有帮助
有谁知道什么会导致此问题?是 IE6 的 bug 还是我的脚本有什么问题?
更新:嗯,感谢这个,我发现它与我的CSS - 如果我禁用 Site.css 它就可以工作。我只考虑了脚本。还是得弄清楚那是什么。
更新:好的,这是由以下 CSS 规则引起的:
body { font-size: 0.7em; }
如果我设置 0.8 或更大,它会起作用,但对于 0.7 及更少的 IE6 会出现指示的错误。
有人可以解释一下吗?是的,它是 IE6 - 从定义上来说很奇怪,但是在我看来这个太奇怪了。
I have a form inside jQuery tabs; I create tabs in a simple way:
$("#tabs").tabs({selected: 1});
The selected index 1 is the tab where form is placed. The problem is, on remote computer with IE6 both selects only display a small blank line instead of list with options when dropdown arrow is clicked:
Incorrect dropdown http://queen3.at.tut.by/DropDownIE6jQuery.PNG
The options are there in page source, and everything actually works on other machines, in other browsers and also in IE6 (though I use IETester).
Everything also works if I
- remove tabs creation, that is .tabs() - options do appear and work; or
- first select tab without form (tab 0), and then click on it - options do appear and work
- only when clicking; programmatic .tabs("select", 1) after tabs creation doesn't help
Does anyone know what can cause this? Is it IE6 bug or something with my scripts?
Update: hm, thanks to this, I found it's something with my CSS - if I disable Site.css it works. I thought about scripts only. Still have to find out what's that.
Update: OK, this was caused by this CSS rule:
body { font-size: 0.7em; }
It works if I set 0.8 or greater, but for 0.7 and less IE6 does the indicated bug.
Can someone explain this? Yes it is IE6 - weird by definition, but this one is too weird in my opinion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也遇到了这个确切的问题,虽然我无法通过改变任何正文字体大小来解决它,但我确实设法使用(稍加修改的)“丑陋的黑客”方法来解决它,如 dev.jqueryui.com/ticket/4734 链接,由 CiscoIPPhone 发布:
似乎超时是避免这种情况的关键漏洞。
I have also ran into this exact problem, although I couldn't fix it by altering any body font sizes, I did manage to get around it using the (slightly modified) "Ugly hack" method as described in the dev.jqueryui.com/ticket/4734 link, posted by CiscoIPPhone:
Seems as though the timeout is the key to avoiding this bug.
我发现此解决方法可以解决某些计算机上的问题,但不能解决其他计算机上的问题。
我的解决方案是最初隐藏样式表中的所有选择元素,然后在调用
$( "#tabs" ).tabs()
之后我使用$('select').show( )
显示它们。这为我解决了。
I found that this workaround fixed the issue on some machines, but not on others.
My solution was to hide all the select elements initally in the style sheet, then after calling
$( "#tabs" ).tabs()
I use$('select').show()
to display them.That fixed it for me.