2013-11-26 4 views
1

왜이 오류가 발생하는지 알 수 없습니다. 나는 그것이 일반 자바 스크립트 함수라는 인상하에 있었다.개체 # <Object>에는 'scrollIntoView'메서드가 없습니다.

$(document).ready(function() { 
     $(".linesresults input[type=submit]").click(function() { 
      console.log('here'); 
      //$('.lineslistwrap').scrollTop($('.lineslistwrap').scrollTop() + $(this).parent().position().top); 
      $(this).parent().scrollIntoView(); 
     }); 
    }); 
+3

* "jQuery 객체에서 호출 할 때 작동하지 않는 이유는 정규식 자바 스크립트 함수"라는 느낌입니다. –

답변

3

scrollIntoView는 DOM 요소에 대한 방법, parent() 반환 JQuery와 객체, 이렇게 봅니다.

$(this).parent()[0].scrollIntoView(); 
관련 문제