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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:06:47+00:00 2026-06-02T19:06:47+00:00

I am using Jquery Ui’s draggable and the revert option. Is there a way

  • 0

I am using Jquery Ui’s draggable and the revert option.

Is there a way to detect whether the element is reverting?

$(function() {
$("#draggable").revert(function(){
alert('the div is reverting');
});

});

Ive seen

   revert:function(){
alert("");
} 

However it seems to set the revert position to where the mouse has been released.

Right now, the option i seem to have is to use mouseup.

  • 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-06-02T19:06:48+00:00Added an answer on June 2, 2026 at 7:06 pm

    It’s actually interesting that that works at all. I was unable to find any mention of it in the documentation. It appears that the function is called and if true is returned it will revert if false then it will not revert. Since you have no return at all, it is treated as false.

    So, if you were using the revert option with true as the value (which means, always revert), then you can simply add a return statement to your function:

    $(function() {
        $("#draggable").revert(function(){
            alert('the div is reverting');
            return true;
        });
    });
    

    If you were setting revert to invalid however, I’m unsure how you could do this.

    And since it’s not documented, use at your own risk I guess.

    EDIT: I looked into it a bit more and apparently an agument is passed to the function which is the droppable it was dropped on, and false if no droppable. So technically you could emulate invalid like this:

    $(function() {
        $("#draggable").revert(function(droppable){
            alert('the div is reverting');
            return !!droppable;  // might just be able to return droppable but I think this is safer
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jquery UI 1.8's autocomplete, is there any known way to take the results
Using Jquery preferably, how do I detect if an element is within the viewable
Using jQuery, one can easily find out whether a particular element is visible using
Using jQuery, I'm trying to change the selected option in a SELECT element to
Using jQuery, what's the best way to find the next form element on the
Using jQuery, is there a way to select all tag that reference a specific
Using jQuery what is the best way of editing option text for a given
Using jQuery's flot, there's a way to allow items to be selected by hovering
Using jQuery, how do you check if there is an option selected in a
using jQuery I have the following code: var selectedIdsArray = $(#selectId option:selected).map(function(){return this.value;}); var

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.