Home  >  Article  >  Web Front-end  >  Introduction to the usage of hover and the usage of live (mouse hover effect)_jquery

Introduction to the usage of hover and the usage of live (mouse hover effect)_jquery

WBOY
WBOYOriginal
2016-05-16 17:38:551457browse
Copy code The code is as follows:

// live is mainly used to bind events to dynamically loaded elements
// Product Catalog
$(".lm_div_q dd").live({
mouseenter: function() {
$(this).find("strong").addClass("tj_strong ");
$(this).find("strong").next().slideDown(200); // Display drop-down box
},
mouseleave: function() {
$ (this).find("strong").removeClass("tj_strong");
$(this).find("strong").next().slideUp(200); // Hide the drop-down box
}
});
//Hover directly binds events
// Product Catalog<br>$(".lm_div_q dd").hover(function( ){ <br>$(this).find("strong").addClass("tj_strong"); <br>$(this).find("strong").next().stop(true,true). slideDown(200); // Display drop-down box <br>}, function(){ <br>$(this).find("strong").removeClass("tj_strong"); <br>$(this).find ("strong").next().stop(true,true).slideUp(200); // Hide drop-down box<br>});




 




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn