我想通過ajax顯示qtip彈出窗口沒有成功。我得到了下面的代碼,但似乎無法檢測到哪裏會出錯。幫助將不勝感激。QTip2 ajax彈出不起作用
<script type="text/javascript">
$(document).ready(function()
{
$('.tiplink').qtip({
content:{
var id = $(this).attr('rel');
text: '<img class="" src="../images/loader.gif" alt="Loading..." />',
ajax:{
url: 'pops.php',
type: 'POST',
loading: false,
data: 'id=' + id
}
},
show: 'mouseover', // Show it on mouseover
hide: {
delay: 200,
fixed: true // We'll let the user interact with it
},
style: {
classes: 'ui-tooltip-light ui-tooltip-shadow',
width: 290
}
});
});
</script>
<a href="#" class="tiplink" rel='1'>show me the popup1!</a>
<a href="#" class="tiplink" rel='2'>show me the popup2!</a>
<a href="#" class="tiplink" rel='3'>show me the popup3!</a>
仔細觀察,如果我放在qtip初始化這樣前ID VAR的分配: VAR ID = $(本).attr( '相對'); $('。tiplink')。qtip({ content:{... 所有工作正常。這裏有什麼缺失或錯誤? – nixxx 2012-08-15 11:56:26
上面的問題是ID變量總是未定義。 var做ajax db查詢.. – nixxx 2012-08-15 12:12:39