2011-01-19 5 views
0
$("li a").click(function() { 
    $(this).parent().css({ width: 160 });    
    $("li").unbind('mouseenter mouseleave'); 
    $("#Container").css({ width: 200 }).animate({ width: 700 }, 1000); 
}); 

현재 (this)를 제외한 모든 li에 120을 설정하고 싶습니다. 당신은 샘플 hereJQuery가 아닌 키워드

답변

1
$("li a").click(function() { 
     $("li").not($(this).parent()).width(120); 
}); 
3
$(this).parent().siblings().css('width',120); 
+0

일 근무

$(this).parent().siblings().css({ width: 160 }) 

시도 할 수 있습니다

감사 –

+0

동의 ... 잘 +1 +1 – sunn0

1
$("li").not($(this).closest('li')).width(120); 
0

. 첫 번째 *와 * 최고의 대답이 받아 들여지지 않았다고 수치스러워합니다.