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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:20:35+00:00 2026-05-23T23:20:35+00:00

I am using draggable and droppable features of jquery-ui. I need to identify whether

  • 0

I am using draggable and droppable features of jquery-ui.
I need to identify whether revert has happened.

Is it possible to trap whether “revert” has happened or not?

  • 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-23T23:20:36+00:00Added an answer on May 23, 2026 at 11:20 pm

    Feels a bit hacky, but a possible solution would be the following:

        $("#draggable").draggable({ revert: function(){if($('#droppable').hasClass('logRevert') == true){
                $('#droppable').removeClass('logRevert'); return false; 
        } 
    else{
    /*Your Code here*/
    return true;
    } 
    });
    

    revert accepts a function, so we only return true, if the draggable is not accepted, for whatever reason.

    Now to make this work, we have to add our .logRevert-class when an acceptable draggable is above the droppable. After it drops and doesn’t get reverted, it removes the helper-class .logRevert. You can now always add code to the return

    $("#droppable").droppable({
        accept: '#draggable',
        over: function(event, ui){$(this).addClass('logRevert');},
        drop: function(event, ui) {
            $(this).addClass('ui-state-highlight').find('p').html('Dropped!');
        }
    });
    

    Derived from Nick Craver’s answer on: jQuery draggable revert based on condition

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

Sidebar

Related Questions

I'm using JQuery's Sortable (not Draggable or Droppable) and I was wondering how I
I'm using jQuery UI's draggable and droppable libraries in a simple ASP.NET proof of
I'm creating a day planner using jquery, draggable and droppable. When a job is
I am using jQuery droppable (in conjunction with jQuery draggable ) to allow the
I'm using the Draggable/Droppable functionality of Jquery to allow drag-and-drop from a TreeView to
Using jQuery and Jquery UI, I have a draggable and droppable area, the draggable
I am using jQuery draggable/droppable to enable elements in a grid to be swapped.
How do I make an element, e.g. a div, draggable using jQuery?
A small question hopefully with a simple answer, I am using jQuery draggable and
I have a simple application that users jquery-ui's draggable and droppable. In Firefox, it

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.