2013-05-15 4 views
1

모두 제목에 있습니다. 자바 스크립트 부트 스트랩 구성 요소가 작동하지 않습니다.Twitter-bootstrap javascript 구성 요소가 작동하지 않습니다.

<div id="example">Some element</div> 

<script> 
    $('#example').popover({ 
    title: 'A title!', 
    content: 'Some content!', 
    trigger: "hover" 
    }); 
</script> 

이것은 작동하지 않고 팝 오버를로드하지 않습니다. 같은 문제 :

$('#try').typeahead(); 

시도해보십시오.

로딩 순서 :

<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script> 
<script src="js/vendor/jquery-1.9.1.js"></script> 
<script src="js/vendor/bootstrap.min.js"></script> 
//or <script src="js/vendor/bootstrap.js"></script> 

내가 데이터를 사용하고 있지 않다는 retrocompatibility을 위해 속성.

답변

5

당신은 지금처럼 페이지로드 이벤트 핸들러에서 자바 스크립트를 포장해야합니다

<script> 
    $(function() 
    { 
    $('#example').popover({ 
     title: 'A title!', 
     content: 'Some content!', 
     trigger: "hover" 
    }); 
    }); 
</script> 

는 jQuery의 .ready() 설명서를 참조하십시오.

+0

nvm.it이이 방법으로 작동하지 않습니다. – lyllo

관련 문제