1
在堆棧溢出時搜索。我發現了一個我也面臨的老問題。但沒有人回答它。 所以只是想知道人有任何想法吧Tooltipster不能在ajax內容中工作
How to get jquery Tooltipster Plugin to work for newly created DOM elements?
以下是我的代碼
$(document).ready(function() {
$('.test_link').tooltipster({
interactive:true,
content: 'Loading...',
functionBefore: function(origin, continueTooltip) {
continueTooltip();
// next, we want to check if our data has already been cached
//if (origin.data('ajax') !== 'cached') {
$.ajax({
type: 'POST',
url: 'example.php',
success: function(data) {
// update our tooltip content with our returned data and cache it
origin.tooltipster('content', $(data)).data('ajax', 'cached');
}
});
// }
}
});
});