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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:25:29+00:00 2026-05-24T04:25:29+00:00

I need to implement drag and drop functionalities in a web application between elements

  • 0

I need to implement drag and drop functionalities in a web application between elements present in a web page, and elements inside an iframe (before you start complaining about iframes, I NEED it for technical reasons, it’s not an option).

I have elements in the page that can be dragged into target droppable elements inside an iframe.

I’ve managed to do it with both jQuery UI and YUI, though both libraries present the same problem: the target element (droppable target) coordinates are misinterpreted, the drop area considered by both libraries is wrong and does not represent the actual droppable object, hence the collisions between the dragged object and the dropped element are messed up entirely. It’s like the library sees the droppable element positioned in another place from where it effectively is.

I think this is due to the iframe not being positioned on top-left of page, but in the middle. I think this because I’ve read many people complaining about this issue and the problem went off if the iframe was top-left positioned. Someone suggest that the coordinates of the droppable element may be calculated based on screenX and screenY, instead of clientX and clientY, and this may be the cause of the issue, not taking into consideration the elements are inside an iframe, and so the coordinates differ between other elements outside the iframe.

So, since it seems there’s no way to fix this directly using the library functionalities, and I really don’t have time to try every library avaiable out there, I’m thinking about fixing the issue by modifying (patching) the internal functions of the library in question.

The questions are:

1) Did someone experience this behavior before, and managed to fix the issue? Or, is there a library which is able to do this flawlessly?

2) Is there some way to fix this issue using the methods and functionalities of the library itself? And if not,

3) Does somebody know which part of the library calculates the droppable area coordinates, so that I can fix it as a last extreme option?

Thanks in advance, even the smallest help will be appreciated!


EDIT

This fiddle demonstrate the problem. Try to move the green square inside the red square (which is inside an iframe). You will notice the collision between the two squares is wrong.

http://jsfiddle.net/DQdZ9/23/

  • 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-24T04:25:30+00:00Added an answer on May 24, 2026 at 4:25 am

    This is not a “silver bullet” , but I’ll go ahead and post this as an answer, but I’m not sure how much value it will have for you. I tracked down a key function in jQuery UI that might be what you’re looking for. It’s in $.ui.ddmanager (the drag and drop manager), and the function is prepareOffsets. This line:

    m[i].offset = m[i].element.offset();
    

    seems to be the one that is setting up the offset for use when the element is actually dropped. This might be a place to fiddle with to adjust the resulting offset based on whether the droppable element is a child of the iframe.

    There is another function above it $.ui.intersect that performs the logic to see if the draggable and droppable are intersecting each other.

    I’m in the latest release of jQuery UI, and the file is jquery-ui-1.8.14.custom.js on line 2012-2029. If you get the single droppable file itself, jquery.ui.droppable.js, it’s on lines 203-220. And these are the dev files, not the min files.

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

Sidebar

Related Questions

I need to implement a drag and drop functionality, where I can define and
I'm trying to implement a simple drag/drop of images between panels using jQuery. While
I'm trying to implement drag and drop on a wx.TreeCtrl and I need to
**I need to implement Drag and Drop in my table view.I have a table
I need to implement a Diff algorithm in VB.NET to find the changes between
I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX
I need to implement a SSO between a SharePoint site and a custom PHP-based
I was trying to implement drag and drop in treeview . I generate the
I started trying to implement drag-and-drop of virtual files (from a C# 4/WPF app)
I'm trying to implement drag and drop capability into a custom data grid control.

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.