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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:33:15+00:00 2026-05-31T01:33:15+00:00

I have a wrapper. Inside that wrapper I have an inner-wrapper. Inside that inner-wrapper

  • 0

I have a wrapper. Inside that wrapper I have an inner-wrapper. Inside that inner-wrapper I have a span. On that span mouseenter, I would like an alert to show the distance between the middle of that span and the right border of the wrapper (the main one: #wrapper). I tried few things with position() but did not manage to achieve what I just mentioned.

http://jsfiddle.net/ZP7Lt/

My html:

<div id="wrapper">
    <div id="inner-wrapper">
        <span id="me">It's me</span>
    </div>
</div>​

My css:

#wrapper{
    width:400px;
    height:300px;
    margin-left:auto;
    margin-right:auto;
    margin-top:100px;
    background-color:yellow;}

#inner-wrapper{
    position:absolute;            
    width:100px;
    margin-left:100px;
    margin-top:50px;
    background-color:blue;}

#me{
    background-color:pink;}

​
My js:

$('#me').mouseenter(function(){


    alert("distance from middle of span till right border of #wrapper???");

})​
  • 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-31T01:33:16+00:00Added an answer on May 31, 2026 at 1:33 am
    $('#me').mouseenter(function(){
        var $wrapper = $("#wrapper"), $this = $(this);
        alert("distance from middle of span till right border of #wrapper is " + ($wrapper.width() - ($this.offset().left - $wrapper.offset().left + $this.width()/2)));
    })​;
    

    Working demo – http://jsfiddle.net/ShankarSangoli/NxhWk/

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

Sidebar

Related Questions

I have a main wrapper div that is set 100% width. Inside that i
I have a program that is running inside eclipse right now and uses a
I have 3 blocks: one wrapper and 2 other inside the wrapper. Inside-blocks have
I have a wrapper generic class that intended to be used with a set
I have a list wrapper that maintains two Tstringlists and a TClassList I need
I have a wrapper of certain width. I want to float 3 boxes inside
I have a div wrapper inside of a div container. The wrapper is 90%width
I have a #wrapper div and a #grid div nested inside. currently I can
This is the code that I have to dynamically declaring an array inside a
I have some nested tables that I want to hide/show upon a click on

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.