해결해야 할 이상한 문제가 있습니다. 솔루션은 순수 JavaScript (프레임 워크가 허용되지 않음) 여야합니다. 여기 있습니다 : "페이지에서 사용 가능한 모든 스타일 시트를 표시하십시오".document.styleSheets [i] .disabled가 크롬에서 작동하지 않습니다.
저는 cssText
스타일 시트의 속성을 가지고 있지만, IE에서는 innerHtml
이라는 여러 발행물로 인해 크롬을 사용합니다. 이는 내 목적에 완벽하게 부합합니다.
어쨌든, 여기에 모든 5 개 스타일을 위해 그것을 바로하지 않은 false
경고, 내 예를
<html>
<head>
<style MEDIA="screen">
h1 {color:blue; font-size:10pt; background-color:cyan}
</style>
<style MEDIA="screen" DISABLED="true">
h4 {color:blue; font-size:10pt; background-color:cyan}
</style>
<style MEDIA="print">
h1 {color:gray; font-size:12pt; font-weight: bold}
h2 {font-style:italic}
</style>
<style DISABLED="true">
h2 {color:green; font-size:12pt}
</style>
<style>
h3 {font-style:italic}
</style>
<script language="Javascript">
function displayActiveStyles() {
var container = document.getElementById('activeStyles');
var i;
for (i=0; i<document.styleSheets.length; i++) {
alert(document.styleSheets[i].disabled);
}
}
</script>
</head>
<body>
<h1>one</h1>
<h2>two</h2>
<h3>three</h3>
<input type="button" value="show" onclick="displayActiveStyles()" >
<hr />
<div id="activeStyles"></div>
</body>
</html>
문제가있다. 누군가 내가 실수하고있는 부분이나 크롬에서 전혀 할 수 없다는 생각이 있다면 알려주십시오.
귀하의 언어와 사용자 이름 ... 충돌 조금;) – Blender
크롬에 http://code.google.com/p/chromium/issues/detail?id=88310&hl=ko 버그가보고되었습니다. Google 크롬 소스를 사용하여 Chrome 브라우저를 구축합니다. –
블렌더, 좋은 점, 헛소리 대신 "말도 안되는"것입니까? – Clergyman