我有一些我试图在 IE10 中工作的 javascript 代码。一直在尝试使用 jquery 来引用 styleSheet 和规则并对其进行初始化。没有帮助。这是代码:
function SetBold(Item, bold)
{
var aitemstyle = document.all.item(Item).style;
if (aitemstyle)
{
if (bold)
{
aitemstyle.fontWeight = "bold";
aitemstyle.color = "black";
aitemstyle.textDecoration = "none";
}
//this else block of code causes function-expected error IE10 windows 8, oRule var initialization
else
{
var oRule=document.styleSheets("panoramaCSS").rules("12pxHoverColorChange");
//IE10 expected function from previous line. So, for loop below for finding 12pxHovercolorChange rule
//inside panoramaCSS styleSheet
//TODO make the selections off Panel Performance go unbold. Not working yet.
}
}
}