$('selector').tipsy({
live: true
});
http://onehackoranother.com/projects/jquery/tipsy/
支持直播活動
的現場活動並使用選項的支持。 jQuery≥1.4.1是必需的,而實時工具提示不支持手動觸發。
編輯
另一種方法是創建完畢後,他們結合醉意的新元素。例如:
$('selector').tipsy();
// post, get, ajax, etc
$.post(..., function(data) {
// in the return function, first create the new elements
...
// call on the tipsy method again
// the selector will now also match the newly created elements
$('selector').tipsy();
});
如果tipsy
方法有很多在它的變量,你不想重複它,它可能是更容易地創建一個單獨的函數。例如:
// create the function
function setupTipsy() {
$('selector').tipsy({
html: true,
gravity: 'w',
etc..
});
}
// call on the function when the document has been loaded
setupTipsy();
// post, get, ajax, etc
$.post(..., function(data) {
// in the return function, first create the new elements
...
// call on the same function again
setupTipsy();
});
doh!謝謝,但如果你正在使用一個沒有這種選項的插件。那麼你怎麼去做呢? – jim 2010-10-08 17:12:56
添加到答案。 – Alec 2010-10-08 18:32:01