cssClass.selectorText在firefox浏览器中发生更改
cssClass.selectorText change in firefox browsers
im在firefox浏览器上尝试更改css类上的选择器文本时遇到问题。
我尝试过的:
for (var i = 0; i < document.styleSheets.length; i++) {
styleSheet = document.styleSheets[i];
for (var j = 0; j < styleSheet.cssRules.length; j++) {
rule = styleSheet.cssRules[j];
// identifies the keyframe rule bearing the same name as the class without the point in the beginning
if ((rule.type == rule.KEYFRAMES_RULE || rule.type == rule.WEBKIT_KEYFRAMES_RULE) && rule.name === className.substr(1)) {
keyframesRule = rule;
}
// identifies the class rule named like the function argument effect
if (rule.selectorText == className) {
animationRule = rule;
mainSheet = styleSheet;
}
}
}
for (var l = 0; l < nrOfElements; l++) {
classAttributes = animationRule.cssText;
mainSheet.insertRule(classAttributes, mainSheet.cssRules.length);
newClasses = mainSheet.cssRules[mainSheet.cssRules.length - 1];
newClasses.selectorText = newClassName[l];
console.log(newClasses.selectorText);
console.log(newClassName[l]);
newClasses.style.setProperty((vendorPrefix + "animation-name"), newClassName[l].substr(1));
}
不幸的是,第一个控制台返回.WPANIM
,而第二个返回.WPANIM + incrementor
。
问题:
为什么cssClass.selectorText
在firefox浏览器上不能用其他东西更改?
Setting.selectorText未在Firefox中实现https://bugzilla.mozilla.org/show_bug.cgi?id=37468
这个问题自16年以来一直存在,请随时向左翼投票或解决它)
相关文章:
- 访问布局信息是否也会导致浏览器重排
- 内部分区字体大小获胜'调整浏览器窗口大小时不会随媒体查询而更改
- 如何使用phaser使html5游戏在移动设备浏览器上运行
- 有时数据是't显示在浏览器中
- 使图像在单击时展开到不大于浏览器
- fetch() 函数未在 Ubuntu Chromium 浏览器上定义
- 不同浏览器中的空白字符正则表达式行为
- 在Windows 10中自动执行例行程序(主要与浏览器交互)
- Windows形成web浏览器控件和Javascript更改的DOM
- 如何临时暂停浏览器渲染,然后恢复整个页面
- 使用angularjs向浏览器发送servlet响应(下载功能)
- 是什么让一个“;Uncaught RangeError:超过了最大调用堆栈大小“;错误(Chrome,在其他浏览器中显示
- 谷歌地图API v3不适用于移动浏览器或PhoneGap
- 禁用(而不是隐藏)浏览器滚动条
- jquery代码在Mozilla中有效,但在其他浏览器上无效
- 如何使用modalDialog来显示可以在所有浏览器中工作的弹出窗口
- 当浏览器上的后退按钮到达主页时,我需要删除Class
- 是否可以在浏览器中使用纯JavaScript保存音频流
- jQuery检测浏览器是否支持Zoom
- 重定向时角度刷新浏览器