$('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