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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:55:58+00:00 2026-05-28T02:55:58+00:00

i have one image and i want that when i will home mouse on

  • 0

i have one image and i want that when i will home mouse on the image then a div will be shown just under the image as bottom center. here i am giving a url just have look that how i want to show my tooltip div just under the image. https://i.stack.imgur.com/aUNKE.png

i dont want to use any plugin. rather i want code my self. i wrote the below code to have the same effect. my code is working but my tooltip div is not appear like bottom center. i am not being able to figure out what to change in the code. i want to set the position by code not by static css.

here is my code

<div class="image" style="margin:0px 25px; position:relative;background:black;  height:50px; width:50px;left:200px;top:200px" />

<div class="tooltip" style="position:absolute;display:none; background:red; height:50px; width:100px;">
</div>

$(".image").hover(function() {
var xtop=($('.image').height()+2);
//var xwidth=$('.image').width();

$(".tooltip").css('margin-Top',xtop+'px')
//$(".tooltip").css('Left',xwidth+'px')

//alert($('.tooltip').left());
//alert(xwidth);

$(".tooltip").show();
}, function() {
$(".tooltip").hide();
})

if possible please change my code to have the effect as i need. thanks


again i am adding the code…it is not working well. the tooltip is not appearing under the image div.

 <div>
<div class="image" style="margin:0px 25px; position:relative;background:black;  height:50px; width:50px;left:200px;top:200px" >
<img id="logo" src="images/warranty2.jpg" border="0" />
</div>
<div class="tooltip" style="position:absolute;display:none; background:red; height:50px; width:100px;">
Hello.......
</div>
</div>

 $(document).ready(function() {
        $(".image").hover(function () {
        var $tt = $(".tooltip");
        var imageWidth = parseInt($(this).width());
        var tooltipWidth = parseInt($tt.width());

        var Imgtop = ($(this).height() + 2);
        var ImgLeftMargin = (tooltipWidth - imageWidth) / 2;

        $tt
    .css({ marginTop: Imgtop + 'px',
        marginLeft: -ImgLeftMargin + 'px'
    })
    .show();
    }, function () {
        $(".tooltip").hide();
    });
});
  • 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-28T02:55:59+00:00Added an answer on May 28, 2026 at 2:55 am
    $(".image").hover(function() {
        var $tt = $(".tooltip");
        var $this = $(this);
        var top = $this.offset().top + $this.width() + 2;
        var left = $this.offset().left - $this.height() / 2;  
    
        $tt.css({ top: top, left: left }).show();
    }, function() {
        $(".tooltip").hide();
    })
    

    Code: http://jsfiddle.net/rGhzk/6/

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

Sidebar

Related Questions

I have one image that I want to add as background image to uibutton.
I have 3 images that I want to add one after other on a
I have one image animation started using GameQuery. Now I want to stop the
I have one big buffer image. I want to create another buffer image with
I want to show an image view for three like on/off,if any one have
I have a image, and i want it to change to another one when
i have created one image but problem is that when i save image from
I have a div that i want to apply two backgrounds to it. Basically
I want to make a container of fixed size that will inside have an
I have one image 768 x 1024 size. second image is on that image

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.