2011-01-26 6 views
1

mac firefox 3.6.13 firebug에서 "removeAttribute가 함수가 아닙니다." 일부 브라우저에서는 "removeAttribute"가 버그가있는 어딘가 읽었지만 사용해야합니다. . 브라우저 문제라면 누구나 다른 방법을 제안 할 수 있습니다."removeAttribute is not function"오류 메시지

function closeThumbView(){ 
    $("#thumbReelBox").fadeOut(1000, function(){ 
    $("#thumbReelList > li > a, #thumbReelList > li, #thumbReelNav, #thumbReelBox").removeAttribute('style'); 
    }); 
} 

답변

4

시도 DOM 요소를 removeAttribute() 방법 사용하기 :

function closeThumbView(){ 
    $("#thumbReelBox").fadeOut(1000, function(){ 
    els = $("#thumbReelList > li > a, #thumbReelList > li, #thumbReelNav, #thumbReelBox"); 
    for(ind=0;ind<els.length;ind++){ 
     els[ind].removeAttribute('style'); 
    } 
    }); 
} 

또는 당신이 원하는 경우를 JQuery 메서드를 사용하려면 응답자 중 하나 인 removeAttr()을 사용하십시오.

function closeThumbView(){ 
    $("#thumbReelBox").fadeOut(1000, function(){ 
    els = $("#thumbReelList > li > a, #thumbReelList > li, #thumbReelNav, #thumbReelBox"); 
    els.removeAttr('style'); 
    }); 
} 
17

removeAttribute는 JavaScript DOM 기능입니다. 당신이 jQuery를 객체에서 작동하여 $()를 사용하고 있기 때문에, 당신은 jQuery를 동등한를 사용해야 removeAttr()

관련 문제