Jquery ui IE7似乎忽略了一些css规则,未能在手风琴中给出一些内容高度

Jquery ui IE7似乎忽略了一些css规则,未能在手风琴中给出一些内容高度,jquery-ui,internet-explorer-7,Jquery Ui,Internet Explorer 7,我正在开发一个带有GoogleMaps元素和基于jQueryUIAccordion/tab的侧边栏的网页。在大多数现代浏览器中,一切都运行得很好,但我在IE7上遇到了几个问题。该网页位于以下位置: 页面上有很多内容;通常,我会尝试创建一个JSFIDLE,但我无法在IE7中运行该站点。我已经使用了很多IE7特定的黑客,现在情况看起来好多了。然而,我仍然有一些问题 我的边栏由一个jquery UI组成,其中包含2个元素。在第二个元素中是一个jquery UI选项卡控件,每个选项卡中都有几个元素。正是

我正在开发一个带有GoogleMaps元素和基于jQueryUIAccordion/tab的侧边栏的网页。在大多数现代浏览器中,一切都运行得很好,但我在IE7上遇到了几个问题。该网页位于以下位置:

页面上有很多内容;通常,我会尝试创建一个JSFIDLE,但我无法在IE7中运行该站点。我已经使用了很多IE7特定的黑客,现在情况看起来好多了。然而,我仍然有一些问题

我的边栏由一个jquery UI组成,其中包含2个元素。在第二个元素中是一个jquery UI选项卡控件,每个选项卡中都有几个
元素。正是这些元素在IE7(如左图所示)和Chrome(如右图所示)中表现不正常

首先,我有一个CSS规则,它应该隐藏这些元素的标题(“安全药物处置放置位置”文本):

但IE7并不适用这一规则。其次,IE7隐藏了应该存在的内容(F12工具显示元素在DOM中,但高度为0)


任何帮助,以及关于下一步尝试的建议,都将不胜感激。

事实证明,代码存在多个问题。首先,IE7要求表在动态创建内容时包含
元素。因此,如果没有注释行,下面的代码将无法工作

var infoTable = document.createElement('table');
var infoTbody = document.createElement('tbody'); //required for IE7!!
var infoTr = document.createElement('tr');
var infoTextTd = document.createElement('td');
var infoPhotoTd = document.createElement('td');
infoDiv.appendChild(infoTable);
infoTable.appendChild(infoTbody);
infoTbody.appendChild(infoTr);
infoTr.appendChild(infoTextTd);
infoTr.appendChild(infoPhotoTd);
其次,IE7不会使用
element.setAttribute('class',className)
将CSS规则应用于给定类属性的动态生成内容。它需要使用
element.className=className

var header = document.createElement('h3');
header.className = 'map-popup-header'; //works as expected in IE7
var header = document.createElement('h3');
header.setAttribute('class','map-popup-header'); //doesn't work in IE7
希望这个答案能帮助别人

var infoTable = document.createElement('table');
var infoTbody = document.createElement('tbody'); //required for IE7!!
var infoTr = document.createElement('tr');
var infoTextTd = document.createElement('td');
var infoPhotoTd = document.createElement('td');
infoDiv.appendChild(infoTable);
infoTable.appendChild(infoTbody);
infoTbody.appendChild(infoTr);
infoTr.appendChild(infoTextTd);
infoTr.appendChild(infoPhotoTd);
var header = document.createElement('h3');
header.className = 'map-popup-header'; //works as expected in IE7
var header = document.createElement('h3');
header.setAttribute('class','map-popup-header'); //doesn't work in IE7