Hover is a mouse hover css effect, but in some browsers such as IE6, only the <a href= ""/> valid.
jquery can solve this problem for us:
jquery-Provided hover ()
method as an event, not only can change the CSS style, but also can do other actions;
Very similar to the combination of mouseover mouseout.
The code is as follows:
$ (function () {
$ (". Htest"). Hover (
function () {
$ (this). CSS ("cursor", "pointer");
$ (this). CSS ("Color", "red");
$ (this). CSS ("position", "relative");
$ (this). CSS ("Top", "2px");
$ (this). CSS ("left", "2px");
},
function () {
$ (this). CSS ("cursor", "pointer");
$ (this). CSS ("Color", "blue");
$ (this). CSS ("position", "relative");
$ (this). CSS ("Top", "0px");
$ (this). CSS ("left", "0px");
}
);
$ (". Mtest"). MouseOver (function () {
$ (this). CSS ("cursor", "pointer");
$ (this). CSS ("Color", "red");
$ (this). CSS ("position", "relative");
$ (this). CSS ("Top", "2px");
$ (this). CSS ("left", "2px");
});
$ (". Mtest"). Mouseout (function () {
$ (this). CSS ("cursor", "pointer");
$ (this). CSS ("Color", "blue");
$ (this). CSS ("position", "relative");
$ (this). CSS ("Top", "0px");
$ (this). CSS ("left", "0px");
});
});