- Эмуляция :hover
-
* HTML .some-block {
_behavior: expression(
function(t, hoverClass){
t.runtimeStyle.behavior = 'none';
hoverClass = hoverClass || t.className ? t.className.replace(/([^\s]+)/g,'$1_hover') : 'hover';
t.attachEvent('onmouseover',function() {
t.className += (' ' + hoverClass);
});
t.attachEvent('onmouseout',function() {
t.className = t.className.replace(new RegExp(' ' + hoverClass,'g'), '');
});
}(this)
);
}
- Эмуляция :focus
-
* HTML .type-text {
_behavior: expression(
function(t, focusClass){
t.runtimeStyle.behavior = 'none';
focusClass = focusClass || t.className ? t.className.replace(/([^\s]+)/g,'$1_focus') : 'focus';
t.attachEvent('onfocus',function() {
t.className += (' ' + focusClass);
});
t.attachEvent('onblur',function() {
t.className = t.className.replace(new RegExp(' ' + focusClass,'g'), '');
});
}(this)
);
}
- Эмуляция :target
-
#SomeBlock {
behavior: expression(
function(t, targetClass){
if (t.id) {
var hash = window.location.hash;
if (!t.targetClass) {
t.targetClass = targetClass || t.className ? t.className.replace(/([^\s]+)/g,'$1_target') : 'target';
}
if (t.lastHash != hash) {
t.lastHash = hash;
if ("#"+t.id == hash) {
t.className += (' ' + t.targetClass);
} else {
t.className = t.className.replace(new RegExp(' ' + t.targetClass,'g'), '');
}
}
} else {
t.runtimeStyle.behavior = 'none';
}
}(this)
);
}