Skip to content

Instantly share code, notes, and snippets.

@atinypixel
Created November 9, 2008 23:35
Show Gist options
  • Save atinypixel/23379 to your computer and use it in GitHub Desktop.
Save atinypixel/23379 to your computer and use it in GitHub Desktop.
/* You can use any element aside from the example below.
How it works is that you simply create .hover, .active styles
for whatever element you use this on. Works very well. Uses
the underscore hack to targe ie6.
*/
input, button {
_azimuth: expression(
this.onmousedown = this.onmousedown || new Function("this.className += ' active'"),
this.onmouseup = this.onmouseup || new Function("this.className = this.className.replace('active','')"),
this.onmouseenter = this.onmouseenter || new Function("this.className += ' hover'"),
this.onmouseleave = this.onmouseleave || new Function("this.className = this.className.replace('hover','')"), 'inherit');
}
input, button
:_azimuth expression(this.onmousedown = this.onmousedown || new Function("this.className += ' active'"), this.onmouseup = this.onmouseup || new Function("this.className = this.className.replace('active','')"), this.onmouseenter = this.onmouseenter || new Function("this.className += ' hover'"), this.onmouseleave = this.onmouseleave || new Function("this.className = this.className.replace('hover','')"), 'inherit')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment