2016-11-13 5 views
1

올빼미 회전 목마 2를 내 웹 사이트에 처음 설치하려고하는데 모든 문구를 따라 가면서 여전히 문제가 있습니다.올빼미 회전 목마 오류

후 수입 모든 파일 :

<head> 
<meta charset="utf-8"> 
<title>The badass man alive</title> 
<!-- CSS --> 
<link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css"> 
<link rel="stylesheet" href="assets/vendors/owl-carousel/assets/owl.carousel.css"> 
<!-- Javascript --> 
<script src="assets/vendors/jQuery/jquery-3.1.1.min.js" type="text/javascript"></script> 
<script src="assets/vendors/owl-carousel/owl.carousel.min.js" type="text/javascript"></script> 
<script src="assets/js/script.js" type="text/javascript"></script> 

데모를 추가하는 자바 스크립트 코드 :

$(function() { 
    $('.owl-carousel').owlCarousel({ 
    loop:true, 
    margin:10, 
    nav:true, 
    responsive:{ 
     0:{ 
      items:1 
     }, 
     600:{ 
      items:3 
     }, 
     1000:{ 
      items:5 
     } 
    } 
    }); 
}); 

그리고 예제 파일로드하려고 :

<div class="owl-carousel"> 
    <div class="item"><h4>1</h4></div> 
    <div class="item"><h4>2</h4></div> 
    <div class="item"><h4>3</h4></div> 
    <div class="item"><h4>4</h4></div> 
    <div class="item"><h4>5</h4></div> 
    <div class="item"><h4>6</h4></div> 
</div> 

콘솔을 티를 돌려 준다. s :

jQuery.Deferred exception: a(...).find(...).andSelf is not a function TypeError: a(...).find(...).andSelf is not a function 
    at c.<anonymous> (file:///.../assets/vendors/owl-carousel/owl.carousel.min.js:2:7592) 
    at HTMLDivElement.e (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:2:3655) 
    at HTMLDivElement.dispatch (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:3:10315) 
    at HTMLDivElement.q.handle (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:3:8342) 
    at Object.trigger (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:4:5808) 
    at HTMLDivElement.<anonymous> (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:4:6318) 
    at Function.each (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:2:2815) 
    at r.fn.init.each (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:2:1003) 
    at r.fn.init.trigger (file:///.../assets/vendors/jQuery/jquery-3.1.1.min.js:4:6294) 
    at e.trigger (file:///.../assets/vendors/owl-carousel/owl.carousel.min.js:1:22366) undefined 
Uncaught TypeError: a(...).find(...).andSelf is not a function(…) 

나는이 오류를 반환하는 이유가 없습니다.

답변

0

동일한 문제가 여기에 있습니다. jQuery의 이전 버전을 사용해 보았지만 정상적으로 작동했습니다. 이전 버전의 jQuery를 사용해보십시오.

1

문제는 이전 버전의 jQuery에서는 andSelf 함수가 없기 때문입니다.

$.fn.andSelf = function() { 
    return this.addBack.apply(this, arguments); 
} 
0

.andSelf() jQuery를 1.8에서 사용되지 않는 및 jQuery를 3.0에서 제거 된 다음 파일을 당신의 .js에 추가하십시오. jQuery 1.8 이후에는 .addBack()을 사용해야합니다.

그래서 당신 owl.caorusel.min.js에 신속하고 더러운 수정, 파일, 그냥 " addBack"로 단어 " andSelf"를 장착하고 작동합니다.

관련 문제