jQuery UI工具提示 - 如何应用于动态添加的元素(不是鼠标悬停和鼠标中心)

时间:2014-03-23 18:23:46

标签: javascript jquery html css

如何将jQuery工具提示应用于动态添加的元素?

我不想使用鼠标悬停和鼠标中心,因为大部分时间这都不会在第一次尝试时显示工具提示。

我也不想在每次ajax调用之后重新应用工具提示,因为这会在我的应用程序中抛出奇怪的不透明度错误(即使我在每次调用之前都将它们摧毁了)。

是否有其他复杂的方法来应用工具提示?

由于

$(document).on('mouseover', '.element-has-tooltip', function(){

    $(this).tooltip({
        items: $(this),
        content : function(){

                return $(this).find('.global-tooltip').html();

            },
        position:{
            my: "center bottom",
            at: "center top",
        },
    })

})

0 个答案:

没有答案