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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:11:39+00:00 2026-05-11T16:11:39+00:00

I have two droppable divs that are very close to each other on the

  • 0

I have two droppable divs that are very close to each other on the screen (note: they are not nested). A large draggable div is dragged on top of the two divs; when the mouse is released, the draggable happens to fall on both droppable divs (i.e. two droppable events are fired).

What I would like to happen, is that in this scenario, the draggable will fall on only one droppable and nother other. Order does not matter at all.

What is the best way in doing this?

One inefficient way that came to my mind is keep track of all droppable event timestamps, and reject a droppable event if it has a timestamp that was already stored before in some array.

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

    I was able to solve my problem in a slightly different way. Let me first recap what my situation is again:

    1. I have two droppable div objects that are very close to each other on the screen
    2. I have a draggable div, that does not have a unique ID. This draggable can be dropped on my droppables time and time again (i.e. it doesn’t get consumed, if that makes any sense)
    3. When a draggable is on top of two droppables, currently the jquery behaviour is that the draggable will hit both droppables. This is an undesired effect for me.
    4. My expected behaviour: the draggable should fall on the first droppable only, and should not get triggered for any other subsequent droppable which is around.

      var tsArray = new Array();

      $(‘.droppable’).droppable({
      drop : function() {

      for (var i = 0; i < tsArray.length; i++) {
          if (tsArray[i] + 150 > ev.timeStamp) {
              return;
          } 
      }
      
      tsArray.length = 0; // Empty it for performance
      tsArray.push(ev.timeStamp);
      
      // Do any logic you require here   
      

      });

    The basic idea is that when a draggable is dropped on two droppables, the event timeStamp of each droppable event are very close to each other. They are milliseconds apart. I simply do a check to ensure that there is a substantial time difference between them.

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

Sidebar

Related Questions

I have two applications written in Java that communicate with each other using XML
I have two divs: one draggable and one droppable <div id=draggable class=block runat=server> </div>
I have two div on my page. One is draggable and other is droppable
It seems that when using two jquery UI droppables that touch each other, the
I have a page (created not by me) with two divs. This divs contains
I have two divs in my page, div1 contains 3 droppable images (p1,p2,p3) and
I have two divs that are float:left: <div id=inventor> <table> <tr id=1><td>Alexander Graham Bell</td></tr>
Have two sets of data (two tables) for patient records, one 1999-2003, the other
I have two tables that have the same structure, I need a query to
I have my screen divided into two DIV s. In the left DIV I

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.