hover的用法及live的用法介绍(鼠标悬停效果)

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

hover的用法及live的用法介绍(鼠标悬停效果)

  2020-05-13 我要评论
复制代码 代码如下:

// live主要用于对动态加载出来的元素绑定事件
// 产品目录
$(".lm_div_q dd").live({
mouseenter: function() {
$(this).find("strong").addClass("tj_strong");
$(this).find("strong").next().slideDown(200); // 显示下拉框
},
mouseleave: function() {
$(this).find("strong").removeClass("tj_strong");
$(this).find("strong").next().slideUp(200); // 隐藏下拉框
}
});
// hover直接绑定事件<PRE class=javascript name="code">// 产品目录
$(".lm_div_q dd").hover(function(){
$(this).find("strong").addClass("tj_strong");
$(this).find("strong").next().stop(true,true).slideDown(200); // 显示下拉框
},function(){
$(this).find("strong").removeClass("tj_strong");
$(this).find("strong").next().stop(true,true).slideUp(200); // 隐藏下拉框
});</PRE><BR>
<BR>
<PRE></PRE>
<BR>
<BR>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们