dennismonsewicz
dennismonsewicz

Reputation: 25542

jQuery Tools Tooltip: show on page load

I am working on a small app and am using jQuery Tools Tooltip ( http://jquerytools.org/documentation/tooltip/index.html ) for the tooltip functionality. I can't figure out how to show the tooltip on page load. Has anyone done this before?

Upvotes: 0

Views: 11441

Answers (3)

dennismonsewicz
dennismonsewicz

Reputation: 25542

After seeing the answer from Matthew and the suggestion from Greg, there are two ways (could be more) of going about doing this.

Here they are.

Using jQuery Tools' API Version

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

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

Using jQuery to activate mouseEnter()

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

Thanks again for the help!

Upvotes: 4

Brian Warfield
Brian Warfield

Reputation: 377

Well it looks like all of the tooltips have '.tooltip' so you could do this.

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

You'll probably want to add some logic to '.fadeOut()' as well

Upvotes: 0

Matthew Darnell
Matthew Darnell

Reputation: 4588

You should be able to trigger the mouseenter event on page load after you initalize the tooltip.

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

Upvotes: 10

Related Questions