It was great to find this guy.
Here is the CSS style
JS Code
- Input {
- border:1px solid #B3D6EF;
- Background: #ffffff;
- }
- Input {
- Star:expression (
- onmouseover=function () {this.style.backgroundcolor="#D5E9F6"},
- onmouseout=function () {this.style.backgroundcolor="#ffffff"})
- }
The advantage is that you don't have to write a bunch of onmouseover functions in the page.
Lolo
Some problems need to be noted, this writing may cause the browser to die under IE6, currently do an old card-dead phenomenon ...
November 24, 2009 1:31:36
Here is a quote from the next monster Fly CSS optimization article
Reference
The biggest problem with the CSS Expression feature in the browser is that it executes repeatedly, potentially hundreds of times per second, and has serious performance problems.
How to optimize the Expression of CSS?
At least: If we execute the CSS Expression only once in the matching element, the performance will be greatly improved.
OLD9 provides a solution in the article "CSS Expression Reloaded":
The CSS property that triggers the expression is reset by referencing it in the body of the CSS expression statement.
JS Code
- div {
- Zoom:expression (function (el) {el.style.zoom = "1"; alert (el.tagname);} (this));
- }
Or
JS Code
- div {
- -singlex:expression (This.singlex 0: (function (t) {alert (t.tagname); t.singlex = 0;}) (this));
- }
Explain it ~:
The CSS Expression executes on any of the matching elements.
Within the CSS expression, the "this" keyword points to the currently matching HTML element.
CSS properties are triggered by using some properties that are not commonly used, and are reset back to the default values after triggering.
This is the original.
http://www.planabc.net/2009/09/21/optimization_of_css_eexpression/
Reference
On expression, the Yahoo team mentions these
18. Avoid using CSS expressions (expression)
CSS expressions are a powerful (but dangerous) way of dynamically setting CSS properties. Internet Explorer supports CSS expressions starting with the 5th version. In the following example, a CSS expression can be used to switch the background color at one-hour intervals:
Background-color:expression (New Date ()). GetHours ()%2? "#B8D4FF": "#F08A00");
As shown above, JavaScript expressions are used in expression. CSS properties are set based on the results of the JavaScript expression calculations. The expression method does not work in other browsers, so it is useful to set it up separately for Internet Explorer in a cross-browser design.
The problem with expressions is that they are calculated more frequently than we think. Not only when the page is displayed and scaled, it is recalculated when the page scrolls, or even when the mouse is moved. Add a counter to the CSS expression to track how often the expression is calculated. Easily move the mouse in the page can be more than 10,000 times the amount of calculation.
One way to reduce the number of CSS expression calculations is to use a disposable expression that assigns the result to the specified style property at the first run, and replaces the CSS expression with this property. If the style attribute must change dynamically within the page cycle, using an event handle instead of a CSS expression is a viable option. If you must use CSS expressions, be sure to remember that they are counted thousands of times and may have an impact on the performance of your pages.
CSS Control Input Tags