我在表格中的项目上调用了 qTip..
$('#orders_table a[rel]').each(function (){
$(this).click(function(){
return false;
});
$(this).qtip({
content: {
// Set the text to an image HTML string with the correct src URL to the loading image you want to use
text: 'Loading...',
url: $(this).attr('rel'),
// Use the rel attribute of each element for the url to load
title: {
text: 'Order Number ' + $(this).text(),
// Give the tooltip a title using each elements text
button: 'Close' // Show a close link in the title
}
},
position: {
corner: {
target: 'bottomMiddle',
// Position the tooltip above the link
tooltip: 'topMiddle'
},
adjust: {
screen: true // Keep the tooltip on-screen at all times
}
},
show: {
when: 'click',
solo: true // Only show one tooltip at a time
},
hide: 'unfocus',
style: {
tip: true,
// Apply a speech bubble tip to the tooltip at the designated tooltip corner
border: {
width: 0,
radius: 4
},
name: 'light',
// Use the default light style
width: 570 // Set the tooltip width
}
})
});
然后我有以下回调函数:
$('#orders_table a[rel]').each(function (){
$(this).qtip({
api: {
onContentLoad:function() {
$('#select').change(function(){
alert('test');
});
}
}
})
});
qTip 正在加载动态内容。该动态内容有一个 ID 为“选择”的选择框。
但由于某种原因,它似乎没有在 qTip 加载动态内容之后调用该函数。
有任何想法吗?我试过onRender 和onContentUpdate,好像不太合适。
谢谢!