table表随着鼠标移动背景变色(jQuery siblings())

阅读更多
jQuery siblings() 方法返回被选元素的所有同胞元素,并且可以使用可选参数来过滤对同胞元素的搜索。
实例1:
$(function(){
$("#table tr").mouseover(function(){
$(this).css("background-color", "#F4F4F4").siblings().css("background-color", "#FFFFFF");  
});
});


实例2:
html代码:


js代码
$(function(){
				$(".dd-inner .item").mouseover(function(){
					$(this).siblings().removeClass("hover");
			        $(this).addClass("hover");			        
				});
			});

你可能感兴趣的:(siblings,jQuery,html)