好吧,过了一会儿我挠了挠头,“啊?”试图找出为什么 IE 在加载我的一个加载了 jQuery 的页面时会直接崩溃,我将罪魁祸首缩小到这一行
$('div#questions').hide();
当我说 IE 崩溃时,我的意思是它完全崩溃了,试图进行网页恢复,但失败了。
我正在运行 jQuery 1.4.2 并使用 IE 8(尚未使用任何其他版本进行测试)
我目前的解决方法是这样的:
if ($.browser.msie) {
window.location = "http://www.mozilla.com/en-US/products/download.html";
}
出于某种原因,我觉得我的 IE 用户不会对此解决方案感到非常满意。
有问题的 div 中有很多内容,其他 div 被隐藏并再次显示,所有这些都工作得很好,只有当巨大的父 div 被隐藏时 IE 才会翻转并刺伤自己。
有没有人遇到过这种情况或者对出了什么问题有任何可能的想法?
EDIT:
一切都包含在 $(document).ready(function() { }); 中
我的代码都是内部的,所以不幸的是我无法链接它。
编辑:发现 IE 8 崩溃代码
<ol class="actionHelp">
<li>List the tasks (or actions) that are involved in your pattern along the top (one per column)</li>
<li>Put the starting point in the first column and the ending point in the last column.</li>
<li>To fill in the middle, simply ask: "What happens next?" If only one thing ever happens next, then it should get 100%. If 70% of the time one thing happens next, and 30% of the time another thing happens next, then put 70 in one box and 30 in the other.</li>
<li>Each row should add up to 100%</li>
<li>The last row is the exit and should not have any percentages in it.</li>
</ol>
我不知道为什么这会在 IE 中引起问题,但这是 CSS
.actionHelp {
margin: 0 0 0 20px;
}
.actionHelp li {
margin: 5px 0;
}
使用无序列表而不是有序列表不会导致崩溃,但是一旦我将其切换回来,我就会再次崩溃,这个元素不需要排序,我只是将其作为具有逻辑意义的步骤存在,我我还是想知道为什么 IE 会被吓坏。
jQuery + IE + 隐藏 ol 元素 = OMG IE FAIL 吗?或者有解决方法吗?
它似乎会影响任何具有列表样式的列表元素,而不是无