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 6118835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:28:56+00:00 2026-05-23T15:28:56+00:00

I would like to display a JSON response (from an ajax call) in a

  • 0

I would like to display a JSON response (from an ajax call) in a tooltip. I would like to position the tooltip relative to its trigger element, an anchor, underneath it to its left. I will have many trigger elements on the same page. I thought of using something like this:

$.ajax({
    // Do stuff
    success: function(response) {
        $(this).after("<div class='tooltip'>" + response.message + "</div>");
    }
});

This code doesn’t solve my problem. It inserts the tooltip in the target element’s container. I need the tooltip to float and be independent from the target element, sort of like the tooltips StackOverFlow displays when you vote on a post.

Any ideas how to do this in jQuery?

  • 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-05-23T15:28:56+00:00Added an answer on May 23, 2026 at 3:28 pm

    To make your tooltip independent of other elements, it should be a direct child of your <body> and with a high z-index CSS property.

    If you try to drop the tooltip into the DOM anywhere else it could interfere with page layout.

    Then just use absolute positioning based on the coordinates of the trigger element.

    .tooltip {
        z-index: 10000;
        position: absolute;
    }
    
    var offset = $(trigger).offset();
    offset.top += $(trigger).height();
    $(tooltip).offset(offset);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I user jquery.ajax call to controller of asp.net mvc... I would like to show
I actually passed a JSON string to the script and would like to display
I am using Jquery templates to display incoming JSON data I would like to
I am using AJAX to submit a form, and would like to display a
I would like to display a category name instead of a number (cat_id) from
I would like display something more meaningful that animated gif while users upload file
I would like to display details of an xml error log to a user
I would like to display some memory statistics (working set, GCs etc.) on a
I would like to display multiple colors (and potentially shapes and sizes) of data
I would like to display some smiley's inbetween text in my chatbox but when

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.