jq 选择$(this)下的某个元素

$(".wrap_xia > div").mouseover(function(){		
		
		$(".wrap_xia > div").css("background","");//清除所有div背景颜色
		$(this).css("background","#bd0000");//给对应的div背景颜色
		
		$(".wrap_xia >div ").find("div:nth-child(2)").stop().animate({"opacity":0},100,function(){
			$(".wrap_xia >div ").find("div:nth-child(2)").css("right",36)
			$(this).animate({"right":45},500)
		});//每个对应的div标签的第二个子元素标签 运动 让透明度为0 紧接着回调函数 改变对应div下第二个元素标签 的position right的位置,36为原始位置, 意思是让45 运动到36
		$(this).find("div:nth-child(2)").stop().animate({"opacity":1},300); //$(this)下第二个div标签
	})
	
	$(".wrap_xia > div").mouseout(function(){
		$(this).css("background","");
		$(".wrap_xia >div ").find("div:nth-child(2)").stop().animate({"opacity":0},100)
	})

  鼠标放上去改变 $(".wrap_xia > div")  下的所有div的背景颜色   并且让所对应div下的第二个子元素 运动改变它定位的right值

主要标签:

$(this).find("div:nth-child(2)")  取到对应div下的第二个子标签


原文地址:https://www.cnblogs.com/mingjixiaohui/p/5295343.html