atinypixel (owner)

Revisions

gist: 23379 Download_button fork
public
Public Clone URL: git://gist.github.com/23379.git
Embed All Files: show embed
Support :hover with IE6 #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* 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');
}
 
 
Version for Sass #
1
2
3
4
        
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')