0

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

4

3 回答 3

9

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

$("#target").mouseenter();
于 2012-03-23T20:56:35.387 回答
4

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

他们来了。

使用 jQuery 工具的 API 版本

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

                var tooltipApi = $('.searchToolTip').data('tooltip');
                tooltipApi.show();

使用 jQuery 激活 mouseEnter()

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

再次感谢您的帮助!

于 2012-03-23T21:04:00.217 回答
0

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

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

您可能还想为 '.fadeOut()' 添加一些逻辑

于 2012-03-23T21:01:09.860 回答