Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
How to highlight opposite drop target?

I have a drop item that can be dragged between 2 drop targets like so

$(document).ready(function() {
   
$(drag_element).draggable({ revert: "invalid"});

    $( "#drop1" ).droppable({
        activeClass: 'blue',
        drop: function( event, ui ) {
          $( this )
          .find( "p" );
        }
      });

      $( "#drop2" ).droppable({
        activeClass: 'blue',
        drop: function( event, ui ) {
          $( this ).find( "p" );
        }
      });  
  } );

My html places the drag_element under drop1 zone to begin with.

However activeClass will highlight both of them. If I'm dragging from drop1 zone I want to highlight drop2 zone. What's a good way to fix this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!