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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:11:32+00:00 2026-05-28T20:11:32+00:00

Please see the jsfiddle Once I drop the ‘draggable’ object on the target, that

  • 0

Please see the jsfiddle

Once I drop the ‘draggable’ object on the target, that particular position is used next time, when reverting back. Is there any way by which I can save the original positions of the draggable objects and always revert them back to them (the very first positions)? Or is there any other solution than ‘saving them’ to achieve the same goal?

I found somewhat similar question, but the positions(left, top) are hardcoded in them to revert back. I tried hard but couldn’t find a solution.

Thank you.

  • 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-28T20:11:33+00:00Added an answer on May 28, 2026 at 8:11 pm

    I’m assuming that when you drop your draggable on the target, you don’t want it to revert, but after you move it back out of the target, you’d like it to revert back to its original position with the rest of the draggables?

    If that’s the case, the code in this answer is what you’re looking for, and although the values 0, 0 for the top and left locations seem hard-coded, they are necessary as the draggables’ position CSS attributes get set to relative after they’ve been turned into draggables, so setting them back to 0, 0 would move them back to their original positions.

    Here’s a jsfiddle example, and also the modified code in your example:

    $('#target').droppable({
    
        // you need to set revert to a function as the 'out' event is turning it
        // into a function...
        drop: function(event, ui){
            ui.draggable.draggable('option', 'revert', function(){return false});
        },
    
        out: function(event, ui){
            ui.draggable.draggable('option', 'revert', function(){
                $(this).data('draggable').originalPosition = {
                    top: 0,
                    left: 0
                };
                return true;
            });
        }
    });
    

    Hope this helps! Please let me know if I’ve missed the mark completely!

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

Sidebar

Related Questions

Please see this jsFiddle: https://jsfiddle.net/Wmq6f/ I have a textarea that has a background image,
Please see this jsFiddle . Note that the click event works just fine (try
This question was asked here but the issue wasn't resolved. Please see this jsfiddle
Please see this: http://jsfiddle.net/uNbYu/1/ If you click submit, the button doesn't do anything, but
This question is related to this question yesterday . Please see current jsfiddle here
please see my fiddle: http://jsfiddle.net/qVHg8/1/ Why isn't the fixedRightCol being positioned at right:0 of
Please check this one: http://jsfiddle.net/sasindu555/nNyxk/8/ You can see Description , Features and Contact Details
please find the code in here: http://jsfiddle.net/yuliantoadi/XQuuT/ you could see grid_1 and grid_2 width
http://jsfiddle.net/4UbKe/3/ Please check out the fiddle to see exactly why it doesn't work. I'm
please see: http://jsfiddle.net/4Z4fQ/19/ consider the following html: <a id=myElement href=http://www.google.com/> <img id=image src=http://www.google.com/intl/en_com/images/srpr/logo3w.png alt=google/>

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.