Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:00:08+00:00 2026-06-09T20:00:08+00:00

I am trying to use jQuery Tools to setup some tooltips dynamically, but I

  • 0

I am trying to use jQuery Tools to setup some tooltips dynamically, but I am having great trouble.

By default when you setup a tooltip in it’s most basic form using jQuery Tools it will take the next element after the tooltip trigger as the actual tooltip.

$("#someElement").tooltip();

In a current application I am working on I have a link that I need to load a tooltip that is not the next element.

Using jQuery Tools you can do this by using:

$("#someElement").tooltip({tip: '#tooltipElement'});

This is great, but I need to be able to set the tip dynamically, which I don’t seem to be able to do.

On the application I have links setup that look like this:

<a href="Javascript:void(0);" class="tooltip-preview" data-tooltip-id="#tooltip-1">Quick Preview</a>
<a href="Javascript:void(0);" class="tooltip-preview" data-tooltip-id="#tooltip-2">Quick Preview</a>
<a href="Javascript:void(0);" class="tooltip-preview" data-tooltip-id="#tooltip-3">Quick Preview</a>...

The tooltips are then at the bottom of the page like this:

<div id="tooltip-1">Some random content here!</div>
<div id="tooltip-1">Some random content here!</div>
<div id="tooltip-1">Some random content here!</div>...

So what I then tried doing to make this work was:

$(".tooltip-preview").tooltip({tip: $(this).attr("data-tooltip-id")});

I have a feeling this doesn’t work because $(this) isn’t used as the $(“.tooltip-preview”) object. If this is the case how do I get that to work?

What happens instead is the next element on each link is used as the tooltip.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:00:10+00:00Added an answer on June 9, 2026 at 8:00 pm

    This worked for me:

    $(".tooltip-preview").each(function(){
        $(this).tooltip({tip: $(this).attr("data-tooltip-id")});            
    });
    

    This answer assumes that in this block:

    <div id="tooltip-1">Some random content here!</div>
    <div id="tooltip-1">Some random content here!</div>
    <div id="tooltip-1">Some random content here!</div>...
    

    You meant this (incrementing id values is the key point here. Note that I also differentiate the random content):

    <div id="tooltip-1">Some random content here! (1)</div>
    <div id="tooltip-2">Some random content here! (2)</div>
    <div id="tooltip-3">Some random content here! (3)</div>...
    

    I was able to duplicate the problem and at first I tried:

    $(".tooltip-preview").tooltip({tip: $(".tooltip-preview").attr("data-tooltip-id")});
    

    That gets you closer but it makes all three of the tooltips “Some random content here! (1)” because that selector only finds the first element with the attribute “data-tooltip-id”.

    So you have to iterate through the elements as indicated above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to use jquery tools tooltip ( http://flowplayer.org/tools/tooltip.html#events)on a form to show hints
I'm trying to use the JQuery tools tooltips plugin in a site that I'm
I'm trying to use both the BlockUI and jQuery Tools Tooltip plugins on the
I'm trying to make tooltips appear using jQuery Tools' tooltip feature. When the mark
I'm trying to figure out how to use JQuery to display some tools when
Does anyone know how to modify jquery tools tooltip: http://flowplayer.org/tools/tooltip.html to use event special
i am trying to use the JQuery tool tip in asp.net application but no
I am trying to preform some basic operations with jQuery and JSON. Presently having
I am trying to use jQuery's .data() tool in a jQuery plugin but I'm
I'm trying to use jQuery Tools Scrollable, I have used it before many times,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.