2012-06-11 2 views

답변

1

이 시도 :

$(document).ready(function() { 
    $('#menu a').qtip({ 
     content: { 
      attr: "data-tooltip" 
     } 
    }); 
}); 

qtip2 문서는이 사용하기위한 말한다 대신 "ATTR"의 "텍스트"

Custom functions that return no valid content will still cause the tooltip to be created! Replace these with an each() loop if this is not the desired behaviour. 

을 당신의 사용을 보면 "attr"라고 표시됩니다.

If no valid content is found within the elements attribute, and content.text is not defined, no tooltip will be rendered. 
+0

감사합니다.이 기능은 훌륭하지만 Chrome에서 경고를 생성합니다. 'qTip2 : 툴팁의 내용을 찾을 수 없습니다! 요소에 대한 툴팁 렌더링 중단 [Object object] ' – olofom

+1

그래, 그런 일이 일어난다. qtip2의 소스 코드를 살펴본 결과, 렌더링 할 내용이 없을 때 (해당 메시지가 가리키는대로) 해당 메시지와 함께 간단한 log() 호출이 있습니다. 개발자가 알 수 있도록 의도적으로 고안된 경고입니다. 오류가없고 코드가 깨지지 않습니다. 정상입니다! – Ian

+0

예, 방금 나 자신을 알아 차렸습니다. 대신 기본 제목 속성을 사용하여 얻습니다. 감사! – olofom