当前位置: 代码迷 >> Web前端 >> live的用法于hover的用法 鼠标悬停成效
  详细解决方案

live的用法于hover的用法 鼠标悬停成效

热度:151   发布时间:2013-04-02 12:35:26.0
live的用法于hover的用法 鼠标悬停效果
// 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直接绑定事件
// 产品目录
	$(".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); // 隐藏下拉框
	});





  相关解决方案