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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:32:10+00:00 2026-05-28T16:32:10+00:00

The question almost says it all… So. im using jQuery’s drag and drop stuff,

  • 0

The question almost says it all…

So. im using jQuery’s drag and drop stuff, and I have the following problem.

I have a div #one and it can be dragged and then dropped into the div #two. Evereything works okay for now.

The thing is, that I want to save the position, where the #one was dropped. I get the position of #one with .position() – after dropping, I call .position() and the problem is that it calculates it’s position relative to it’s parent div (wrapper).

I want the script to calculate the position of #one relative to the #two (div where I dropped #one).

I cheated a bit, created #one immidiately in #two, and set it’s left and top properties to -120px and 0px, so that the div would show outside #two, and when I dragged then #one into #two, I would get proper position.. But I don’t want to do this like that..

Is there a way to find absolute position on #one relative to the #two after it was dropped in it ?

  • 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-28T16:32:11+00:00Added an answer on May 28, 2026 at 4:32 pm

    If I understood correctly, You want to find position (left,top) of #one w.r.t #two. If so, you can use .offset function to find the position of #two and #one and subtract their position to get the relative position of the #one inside #two.

    DEMO here

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

Sidebar

Related Questions

In the STL almost all containers have an erase function. The question I have
The question is almost complete in the title: is there any way, using jquery,
I have a web application that once signed in, personalizes almost all pages. I
The question says it all... its pretty simple, and it can be done by
The title basically says it all. Suppose I have an element which I want
UPDATE: I added an answer to this question which incorporates almost all the suggestions
Seeing various locking related question and (almost) always finding the 'loop because of spurious
This is almost similar question to this one: - Dealing with timezones in PHP
When I asked this question I got almost always a definite yes you should
EDIT: There is the almost same question at Removing whitespace between HTML elements 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.