The hover attribute is no stranger to everyone when writing css. live is mainly used to bind events to dynamically loaded elements. We will introduce the usage of the two in detail, do not miss out on friends you are interested in.
The Code is as follows:
// Live is mainly used to bind events to dynamically loaded elements.
// Product catalog
$ (". Lm_p_q dd"). live ({
Mouseenter: function (){
$ (This). find ("strong"). addClass ("tj_strong ");
$ (This). find ("strong"). next (). slideDown (200); // display the drop-down list
},
Mouseleave: function (){
$ (This). find ("strong"). removeClass ("tj_strong ");
$ (This). find ("strong"). next (). slideUp (200); // hide the drop-down list
}
});
// Hover directly binds the event
// Product catalog
$ (". Lm_p_q dd"). hover (function (){
$ (This). find ("strong"). addClass ("tj_strong ");
$ (This). find ("strong"). next (). stop (true, true). slideDown (200); // display the drop-down box
}, Function (){
$ (This). find ("strong"). removeClass ("tj_strong ");
$ (This). find ("strong"). next (). stop (true, true). slideUp (200); // hide the drop-down box
});