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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:47:03+00:00 2026-06-14T12:47:03+00:00

I am creating a checker variation game. I am new to jquery but through

  • 0

I am creating a checker variation game.
I am new to jquery but through some help the pieces can now move around the board.

Is there a way to indicate the start location and end location of a move?

I would also like to disable all piece movement once a move has been made.

jsfiddle can be found here: http://jsfiddle.net/blueberrymuffin/mwu3u/1/

Thanks.

Here is the javascript code:

function drag(ob){       
  ob.dataTransfer.setData("Text",ob.target.id);     
}

function drop(ob){
  var id = ob.dataTransfer.getData("Text");     
  var t = ob.target;    
  if (ob.target.nodeName == "IMG")
    t = ob.target.parentNode;
  t.innerHTML = "";
  var img = document.getElementById(id);
  t.appendChild(img);
  ob.preventDefault();    
}

function allowDrop(ob){
  ob.preventDefault();
}
  • 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-14T12:47:04+00:00Added an answer on June 14, 2026 at 12:47 pm

    It is easily if you agree to use JQuery (your code above doesn’t contain JQuery source code)

    Have a look on the JQueryUI draggable and droppable widget http://jqueryui.com/

    Here is a piece of code permitting to retrieve the source location after element dropping :

      $( ".cases" ).droppable({ 
        drop: function(event, ui) {
            console.log(event.target.id);
            console.log(ui.draggable[0].parentElement.id);
    
            var target = event.target.id;
            var source = ui.draggable[0].parentElement.id;
    
        }
      }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've looked through some posts around here, but am still struggling to get my
Creating a class at runtime is done as follows: klass = Class.new superclass, &block
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
Creating a simple RPG game, first time using XNA. Trying to get my character
Basically i am creating an update checker for emesene on osx. I need to
I am creating a site that requires a very small postcode checker. I have
So I am creating a small online quiz application with jQuery and PHP ...
Hi I am creating Spell Checker for my c# application. I am using using
I am creating a Distinct extension method where I can pass in the criteria
I am creating input fields with jquery var randomNum = Math.ceil(Math.random() * 99999); $(<p

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.