我是靠谱客的博主 虚拟橘子,这篇文章主要介绍hover的用法及live的用法介绍(鼠标悬停效果),现在分享给大家,希望可以做个参考。

复制代码 代码如下:

// 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>

最后

以上就是虚拟橘子最近收集整理的关于hover的用法及live的用法介绍(鼠标悬停效果)的全部内容,更多相关hover内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(224)

评论列表共有 0 条评论

立即
投稿
返回
顶部