1
우리의 개발자 중 하나가 배너 회전기를 사용하며, IE가 제대로 작동하지 않을 때 IE는 30 번째 줄에 오류가 발생합니다. 아래에 "***** ERROR ON NEXT LINE"으로 표시). $$ ('. banner')를 정렬 할 수 없습니까?프로토 타입 Javascript 오류 (IE에만 해당) '개체가이 속성 또는 메서드를 지원하지 않습니다.'
오류 : 의 모든 후 프로토 타입을 1.6.0.3
function changeBanners() {
// banners are now sorted by their z index so that
// the ones most in front should be most on top in the DOM
// ***** ERROR ON NEXT LINE
banners = $$('.banner').sort(function (a,b){
_a = parseInt(a.style.zIndex);
_b = parseInt(b.style.zIndex);
return _a < _b ? 1 : _a > _b ? -1 : 0;
});
// increment z index on all of the banners
Element.extend(banners);
banners.each(function (banner){
Element.extend(banner);
banner.style.zIndex = parseInt(banner.style.zIndex) + 1;
});
// move the first banner to be the last
first_banner = banners.shift();
banners.push(first_banner);
// set it invisible
Effect.toggle(first_banner.id , 'appear' , {
duration: 2.0,
afterFinish: function(){
first_banner.style.zIndex = 0; // update its z index so that it is at the end in the DOM also
first_banner.show(); // make it reappear so that when the one in front of it disappears, it will show through
}
});
};
빈 함수를'sort' 메소드에 전달하고 에러를 검사하도록하십시오. –
빈 함수가 "Number Expected"를 던졌습니다. a> b를 sort 함수로 반환하면 "개체가이 속성 또는 메서드를 지원하지 않습니다."라는 오류가 반환되었습니다. – Jarrett
'forEach'를'each'로 변경하십시오. (! this.currentlyExecuting) : –