2011-10-10 4 views
0

전체 문서를 찾을 수 없습니다. 예를 들어, popover 효과 (here)는 그 내용으로 data-cotent를 자신의 제목과 같은 DOM의 data-origin-title 속성을 사용하고됩니다트위터 - 부트 스트랩 사용법을 어떻게 알고 있습니까?

$('#somedom').hover (-> 
    $(this).addClass("hover") 
    $(this).attr("data-original-title","Location") 
    $(this).attr("data-content":'The popover plugin provides a simple interface for adding popovers to your appli cation. It extends the bootstrap-twipsy.js plugin, 
       so be sure to grab that file as well when including popovers in your project!') 
    $(this).popover({}) 
    $(this).popover("show") 
    ),-> 
     $(this).removeClass("hover") 

어디를 배우는? 공식 문서에는 data-origin-title 속성이 없습니다. 소스 코드도 bootstrap-popover.js이 아닙니다.

답변

3

당신이 필요로하는 것은 바로 여기 옵션 테이블에 있습니다. 제목에 대해서는 title 속성을 가져오고 내용 (3 열)에 대해서는 data-content을 붙입니다. HTML에서 볼 수있는 data-original-title은 실행 후 플러그인 스크립트에 의해 추가되고 무시됩니다.

$('#mything').popover() 
:

<div id="mything" title="My title=" data-content="Some text here">Test popover</div> 

그래서 스크립트 만이, 당신은 이벤트를 처리 할 필요가 없습니다 않습니다

이것에 대한 아이디어는 이미 HTML에 대한 정보를 가지고있다