2012-09-19 2 views
0

내 사이트에서 웹 페이지를 볼 때 브라우저가 다운되는 경우 21 행의 내 스크립트 만 알 수 있습니다. 무엇이 잘못 되었습니까? 아무도 문제를 볼 수 있습니까?jQuery Error on Plugin?

jQuery.fn.carousel = function(previous, next, options){ 
    var sliderList = jQuery(this).children()[0]; 

    if (sliderList) { 
     var increment = jQuery(sliderList).children().outerWidth("true"), 
     elmnts = jQuery(sliderList).children(), 
     numElmts = elmnts.length, 
     sizeFirstElmnt = increment, 
     shownInViewport = Math.round(jQuery(this).width()/sizeFirstElmnt), 
     firstElementOnViewPort = 1, 
     isAnimating = false; 

     for (i = 0; i < shownInViewport; i++) { 
      jQuery(sliderList).css('width',(numElmts+shownInViewport)*increment + increment + "px"); 
      jQuery(sliderList).append(jQuery(elmnts[i]).clone()); 
     } 

     jQuery(previous).click(function(event){ 
      if (!isAnimating) { 
       if (firstElementOnViewPort == 1) { 
        jQuery(sliderList).css('left', "-" + numElmts * sizeFirstElmnt + "px"); 
        firstElementOnViewPort = numElmts; 
       } 
       else { 
        firstElementOnViewPort--; 
       } 

       jQuery(sliderList).animate({ 
        left: "+=" + increment, 
        y: 0, 
        queue: true 
       }, "swing", function(){isAnimating = false;}); 
       isAnimating = true; 
      } 

     }); 

     jQuery(next).click(function(event){ 
      if (!isAnimating) { 
       if (firstElementOnViewPort > numElmts) { 
        firstElementOnViewPort = 2; 
        jQuery(sliderList).css('left', "0px"); 
       } 
       else { 
        firstElementOnViewPort++; 
       } 
       jQuery(sliderList).animate({ 
        left: "-=" + increment, 
        y: 0, 
        queue: true 
       }, "swing", function(){isAnimating = false;}); 
       isAnimating = true; 
      } 
     }); 
    } 
}; 

라인 (21)은 IEHTML5 요소

jQuery(sliderList).append(jQuery(elmnts[i]).clone()); 

내가

$('.viewer').each(function() { 
    $(this).carousel('.viewer .simplePrevious', '.viewer .simpleNext'); 
}); 
+0

html을 게시하고 플러그인을 호출하는 방법은 무엇입니까? –

+0

라인 21이 무엇인지 말씀해 주시겠습니까? 나는 이것이 파일이 시작되는 방법이 아니라고 가정하고있다 – moopet

+0

필자가 내 질문을 수정 @moopet – Liam

답변

-2

이가 내 플러그인 ... 전화입니까? html5shiv에서도 비슷한 문제가 발생했습니다. 다시 작동하려면 xhtml로 되돌려 야했습니다.