Все expression в одном месте

Решил собрать в одном месте все скрипты для эмуляции свойств в IE6 (которые он не знает просто так)
Эмуляция :focus на примере textarea
textarea:focus { color:#fff; }
textarea { font-variant: expression(runtimeStyle.fontVariant = currentStyle.fontVariant, attachEvent("onfocus", function(){ className += ((className) ? " " : "") + "ie-focus" }), attachEvent("onblur", function(){ className = className.replace(/^ie-focus\\s*|\\s+ie-focus/g, "") })); }
Когда textarea получает фокус, ему добавляется класс “ie-focus”, когда теряет, то класс удаляется.
Эмуляция :after на примере тега a
a{F:expression(style.F!=1?(innerHTML+="\x28 тот самый after \x29",1):1)}
a:after{content:'(тот самый афтер)'}
Эмуляция :before на примере тега a
a{z-index: expression(runtimeStyle.zIndex = 1, this.innerHTML = "Текст" + this.innerHTML);}
a:before{content:"Текст";}
Эмуляция [type="text"] (также и других полей по аналогии)
input[type="text"] {width: 120px;}
input {width:expression(this.type=='text' ? '120px' : '');}
Эмуляция :first-child
.class li {
background:green;
background:expression(this.previousSibling==null?'red':'green');
}
.class li:first-child {
background:red;
}
Эмуляция :last-child
.class li {
background:green;
background:expression(this.nextSibling==null?'red':'green');}
}
.class li:last-child {
background:red;
}
Эмуляция min-width
.class {
min-width:220px;
width:expression((document.documentElement.clientWidth || document.body.clientWidth) > 220? "220px":"auto");
}
Эмуляция max-width
.class {
max-width:266px;
width:expression((document.documentElement.clientWidth || document.body.clientWidth) < 266? "266px":"auto");
}
Эмуляция min-height
.class {
min-height:333px;
height:expression( this.scrollHeight < 334 ? "333px" : "auto" );
}
Эмуляция max-height
.class {
min-height:333px;
height: expression( this.scrollHeight > 332 ? "333px" : "auto" );
}
Прозрачность png в IE6
.class {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=/images/pic.png);
}
Tweet

