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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:37:25+00:00 2026-06-02T23:37:25+00:00

I have made this chess game, but i need help with the accept setting

  • 0

I have made this chess game, but i need help with the accept setting in jQuery UI Droppable.

Here is the fiddle:
http://jsfiddle.net/kevinsimper/ZzHjz/3/

I tried to do that, when you drop something, it will update all the td there are empty, but it do not seems to work.

Can you help me?

  • 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-02T23:37:27+00:00Added an answer on June 2, 2026 at 11:37 pm

    The question should probably have stated:

    After dragging an element, the recently vacated td does not become
    a valid, droppable, target for future drags.

    The problem was:
    You were only creating droppable objects on the initial set of td:empty. Therefore, any non-empty td did not even have a droppable object created to manipulate.

    The solution is:
    Create droppable objects on all the td’s. Then disable droppability on all the non-empty td’s. Note that you don’t have to enable droppability on all the td:empty’s every time. You only have to enable it on the recently vacated td. (You should also disable droppability on the newly occupied td.)

    http://jsfiddle.net/pabo/7M3WJ/

    $('a').draggable({ containment: "table", revert: 'invalid' });
    
    $('td').droppable({
        drop: function(ev, ui) {
            var dropped = ui.draggable;
            var droppedOn = $(this);
            $(droppedOn).droppable("disable");
            $(dropped).parent().droppable("enable");
            $(dropped).detach().css({top: 0, left: 0}).appendTo(droppedOn);
        }
    });   
    
    $('td').not('td:empty').droppable("disable");
    

    …incidentally, shouldn’t a chess board be 8×8, and not 10×10?

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

Sidebar

Related Questions

I have made this game for Mac OS, but I realised that i need
I have made this webpage, you can check it out here http://www.bettingtowin.net/webcam.html I have
Hi, I have made this simple script but I need to have it check
I have made this fiddle: http://jsfiddle.net/4CtLV/ Now, what i'm trying to do, is if
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I have made some progress with the DataList and UserControl this morning but I
I have made this function, that seems to work fine, but it return #
I have made this job,that should be executed in an interval of 1 minute,but
I have made this infinitely scrolling script, but I can't rebind the window scroll
I have made this controller, which should be used to send emails. I need

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.