저는이 문제가 새로운 qTip 버전과 jQuery 사이의 비 호환성으로 인해 발생한다고 생각합니다.
qTip을 사용하여 지난 1 시간 동안 테스트 코드를 사용하여 코드가 작동하지 않는 이유와 forums을보고 나서 비슷한 문제를 발견 할 수 있는지 알아 보았습니다. 스레드가 완벽하게 작동하지만 최신 버전의 jQuery로 교체하면 오류가 발생합니다.
<html>
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.qtip-1.0.0-rc3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.fn.qtip.styles.tooltipDefault = {
background : '#132531',
color : '#FFFFFF',
textAlign : 'left',
border : {
width : 2,
radius : 4,
color : '#C1CFDD'
},
width : 220
}
// we are going to run through each element with the classRating class
$('.classRating').each(function() {
var rating = $(this).attr('rating');
// the element has no rating tag or the rating tag is empty
if (rating == undefined || rating == '') {
rating = 'I have not yet been rated.';
}
else {
rating = 'The rating for this is ' + rating + '%';
}
// create the tooltip for the current element
$(this).qtip({
content : rating,
position : {
target : 'mouse'
},
style : 'tooltipDefault'
});
});
});
</script>
</head>
<body>
<div id="SomeID1" class="classRating" rating="73">I have a rating</div>
<div id="SomeID2" class="classRating" rating="66">I have a rating</div>
<div id="SomeID3" class="classRating" rating="">I have a rating but it is empty</div>
<div id="SomeID4" class="classRating">I dont have a rating</div>
</body>
</html>
jQuery 1.3.2 from the Google Code website이 예제는 이제 완벽하게 작동합니다. 나는 다른 문제가 있는지를보기 위해이 코드를 나의 요구에 맞추기 시작할 것입니다. 그러나 여전히이 문제를 겪고있는 누군가를 위해 나는이 게시물이 유용하기를 바랍니다.
편집 :이 버전의 호환성 문제처럼 같습니다. 설명서 웹 사이트의이 간단한 코드는 이제 동일한 버전에서 완벽하게 작동합니다. 희망이 당신을 위해 도움이됩니다!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<a href="#" title="Hello World" class="example">Test</a>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.qtip-1.0.0-rc3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// By suppling no content attribute, the library uses each elements title attribute by default
$('a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
style: 'cream' // Give it some style
});
// NOTE: You can even omit all options and simply replace the regular title tooltips like so:
// $('#content a[href]').qtip();
});
</script>
</body>
</html>
편집 2 : 당신이 다음 중 하나를 다운로드 할 수 있습니다 jQuery를 최신 버전으로 qTip을 사용하려는 그러나 경우에, 그것을 위해 기다릴만한 가치가 될 수 있도록 작품 qTip의 새 버전이 qTip에 대해서는 nightly builds입니다. 위의 예제를 사용하여 최신 야간 빌드와 최신 jQuery (1.4.2)의 두 스크립트를 바꿨다.
이 플러그인을 작동시키려는 시도를 한 후에이 페이지로와 봤습니다. 당신이 생각하는 것처럼 문서가 잘 쓰여 있지 않다고 말할 수 있습니다. 그렇지 않으면이 질문을 쓸 필요가 없습니다. –
EnderMB에 꼭 동의하십시오. 하나에게 명백한 것이 반드시 모든 것을위한 것은 아닙니다. qtip 사이트의 문서가 분명하지 않습니다. 쉽게 접근 할 수있는 완전한 코드가있는 간단한 예는 없습니다. – tucson
이 둥근 모서리 샘플을 따르려고한다면, 그것을 작동시키는 것은 불가능합니다. http://craigsworks.com/projects/qtip2/tutorials/styling/#corners –