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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:32:58+00:00 2026-05-12T18:32:58+00:00

I have a droppable container with >1 draggables in it. I want to simply

  • 0

I have a droppable container with >1 draggables in it. I want to simply be able to see the position of each draggable every time any one of them is dragged. Sounds easy, but I’m having a tough time figuring it out. Here’s what I have:

<script type="text/javascript">
$(function() {
    $("#draggable").draggable({ containment: '#droppable' });
    $("#draggable2").draggable({ containment: '#droppable' });
    $("#droppable").droppable({
        drop: function(event, ui) {
            document.getElementById('position1').value = ui.position.top + ', ' + ui.position.left; 
        }
    });

});
</script>

Basically, where I have the position1 input id gathering the position, I want to have a second line do the same thing for the other draggable.

  • 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-12T18:32:58+00:00Added an answer on May 12, 2026 at 6:32 pm

    In your case, you don’t need to use the ui parameter. Since you know what elements are draggable, you can select them specifically and find their positions. Also, since you’re using jQuery, do yourself a favor and replace document.getElementById with $. 🙂

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

Sidebar

Related Questions

suppose I have a panel with draggable element, and a droppable container,when I drag
I have two divs: one draggable and one droppable <div id=draggable class=block runat=server> </div>
I have a some draggables in a list of droppables (1 draggable per droppable
I have a draggable object (div), and some droppable ones (table TD's). I want
I have a problem with jQueryUI and the draggable/droppable options. What I want to
so I have found that when I add both .draggable() and .droppable() to an
I have the following jQuery: $(document).ready(function () { $(.element).draggable(); $(.element).droppable({ drop: function () {
have written this little class, which generates a UUID every time an object of
I have a simple application that users jquery-ui's draggable and droppable. In Firefox, it
I have a list of tasks that are all draggable and droppable. All of

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.