2012-07-03 11 views
0

에서 하나 개 이상의 클래스를 제외 나는 내 탐색 항목에 배경 이미지 스프라이트를 애니메이션 다음 스크립트가 : 지금 호버 스크립트에서 두 번째 클래스를 제외 할호버 기능

$j(function() { 
    $j(".menu-item:not(.current-menu-item) .bottom_nav").hover(function() { 
     $j(this).animate({ 
     backgroundPosition : '0px 35px'} 
     , 300); } 
    , function() { 
     $j(this).animate({ 
     backgroundPosition : '0px 0px'} 
     , 600); } 
    ); 
}); 

합니다.

$j(".menu-item:not(.current-menu-item, .current-menu-parent) .bottom_nav").hover(function() { 

$j(".menu-item:not('.current-menu-item, .current-menu-parent') .bottom_nav").hover(function() { 

을하지만 둘 다 가져가 스크립트를 휴식 : 나는 형태로 추가 시도했다.

답변

2

의 jQuery이 아니요()/: documentation 선택하지 -

이 아니요를()는에 복잡한 선택기 또는 변수를 밀어보다 더 많은 읽을 수 선택 당신을 제공 종료됩니다 방법 :) (하지 를 선택기 필터. 대부분의 경우 더 나은 선택입니다.

$j(".menu-item").not(".current-menu-item,.current-menu-parent").find(".bottom_nav").hover() 
+0

감사합니다. – Nick