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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:31:57+00:00 2026-06-13T13:31:57+00:00

I need only 1 block in one drop-area and switch if needed. Why I

  • 0

I need only 1 block in one drop-area and switch if needed. Why I can disable, but can’t enable a droppable function?

  • $(this).droppable("option", "disabled", false); – doesn’t work
  • $(this).droppable("enable"); – doesn’t work
  • Enable a droppable after it has being disable – doesn’t work

Here is my code:

$('.my_block').draggable({
    revert: "invalid",        
});

$('.free').droppable({         
    accept: ".my_block",
    drop: function(ev, ui) {             
        $(this).removeClass("free");    
        $(this).addClass("1");                
        ui.draggable.appendTo($(this)).removeAttr('style');
            $(this).droppable("disable");              
        },
        out:  function(ev, ui) {                     
            $(this).droppable("enable");    
            $(this).removeClass("1");    
            $(this).addClass("free");            
        },        
    });

jsfiddle http://jsfiddle.net/4ABCN/2/

And how can I back all red blocks to main positions by one button?

  • 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-13T13:31:58+00:00Added an answer on June 13, 2026 at 1:31 pm

    Working demo Deleted old demo

    New Demo Try this: http://jsfiddle.net/7EbKS/

    Behaviour: Now when user moves the red box you are allowed to drop another one in empty position,

    Hope it fits the cause :)

    Code

      $(function() {
        foo();
    
        $('.my_block').draggable({
            revert: "invalid",
            stop: function() {
                $(this).draggable('option', 'revert', 'invalid');
            }
    
        });
    
        function foo() {
            $('.block').droppable({
                greedy: true,
                accept: ".my_block",
                // tolerance: "fit",
                drop: function(ev, ui) {
                    ui.draggable.appendTo($(this)).removeAttr('style');
                 }
            });
        }
        $('.my_block').droppable({
            greedy: true,
            tolerance: 'touch',
            drop: function(event, ui) {
                ui.draggable.draggable('option', 'revert', true);
            }
        });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need background transparent only for black div. but it is applying even for
I have a large project but I need only some folders in my svn
My question is pretty similar to that except but I need only the header
I'm writing my own simple drop-down...and it's not going so well. I need only
Quick sanity check. Is Array.Copy for one dimensional arrays only, or can it handle
I have a string and need a RegEx Pattern for this, so I can
Onsubmit I want to fire fancybox popup I need only to show the fancybox
I only need to download the first few kilobytes of a file via HTTP.
I only need a table to show 3 rows which get top 3 selling
I need to only get tumblr posts which have been tagged with 'diary' Here

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.