Previous Message
Next Message

whatever:hover fast and easy via Dynamic Properties

Sent by Klaus Hartl on 12 July 2005 16:04


> .whatever {
 >     behavior: expression(
 >         this.onfocus = function() { this.className += ' 
whateverfocus'; },
 >         this.onblur = function() { this.className =
 > this.className.replace('whateverfocus', ''); });
 > }

(Mis)Using the behavior property is a bad idea. I had some strange side 
effects, i.e. it threw IE in a loop loading background images over and 
over again.

whatever:focus though works perfectly:


/* whatever:focus */
input, select, textarea {
     background-color: expression(this.runtimeStyle.backgroundColor,
         this.onfocus = function() { this.className += ' onfocus'; },
         this.onblur = function() { this.className = 
this.className.replace('onfocus', ''); }
     );
}


Regards,

Klaus

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: