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?
The question should probably have stated:
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/
…incidentally, shouldn’t a chess board be 8×8, and not 10×10?