2010-08-18 3 views
1

나는 다음과 같은 오류 얻을 :jQuery를 IE8 숨기기() 함수에 오류

jquery1.4.2.js
Line: 2828
Error: The Object does not support the method.

내 자바 스크립트 코드 : 파이어 폭스에

$(document).ready(function() { 
    //When page loads... 
    $(".tab_content").hide(); //Hide all content 
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab 
    $(".tab_content:first").show(); //Show first tab content 
    //On Click Event 
    $("ul.tabs li").click(function() { 
     $("ul.tabs li").removeClass("active"); //Remove any "active" class 
     $(this).addClass("active"); //Add "active" class to selected tab 
     $(".tab_content").hide(); //Hide all tab content 
     var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content 
     $(activeTab).fadeIn(); //Fade in the active ID content 
     return false; 
    }); 
}); 

그것이해야처럼 작동합니다!

도움 주셔서 감사합니다.

+0

아마도 조금 더 코드를 포맷 해보십시오. – ScottE

+0

코드에서 오류를 일으키는 줄은 무엇입니까? – Tomalak

+0

IE8 툴바는 $ (". tab_content")를 가리 킵니다. hide(); – phx

답변

0

당신과 같이 클릭 이벤트에 debugger; 문을 넣을 수 :

$("ul.tabs li").click(function() { 
    debugger; 
    $("ul.tabs li").removeClass("active"); //Remove any "active" class 

당신은 다음의 단계 씩 할 수 팝업에 그렇게하기로 결정한다.

실제로 콘솔에있는 행에서 오류가 발생합니까?

+0

해결 방법은 appenClass ('hidden')을 수행하는 것입니다. 지금은 저에게 효과적입니다. 도움 주셔서 감사합니다. – phx

관련 문제