jQuery Tools工具提示:在页面加载时显示



我正在开发一个小型应用程序,并且正在使用jQuery Tools Tooltip(http://jquerytools.org/documentation/tooltip/index.html)以获取工具提示功能。我不知道如何在页面加载时显示工具提示。以前有人这样做过吗?

初始化工具提示后,您应该能够在页面加载时触发mouseenter事件。

$("#target").mouseenter();

在看到Matthew的答案和Greg的建议后,有两种方法(可能更多)可以做到这一点。

它们在这儿。

使用jQuery Tools的API版本

$('.searchToolTip').tooltip({
                    position: 'bottom center'
                });
                var tooltipApi = $('.searchToolTip').data('tooltip');
                tooltipApi.show();

使用jQuery激活mouseEnter()

$('.searchToolTip').tooltip({
                    position: 'bottom center'
                }).mouseenter();

再次感谢您的帮助!

看起来所有的工具提示都有'.tooltip',所以你可以这样做。

$(function(){
    $('div.tooltip').fadeIn();
});

您可能需要为".fadeOut()"以及添加一些逻辑

最新更新