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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:54:55+00:00 2026-06-09T21:54:55+00:00

I have a drag and drop event in a game I am creating. Instead

  • 0

I have a drag and drop event in a game I am creating. Instead of dragging the element to the drop zone, I want to be able to click the draggable then the drop zone and animate the movement of it. Can it be done so the user doesn’t have to physically drag it?

If so, where would I go from here…

$('.drag').draggable({

helper: 'clone',
snap: '.drop',
grid: [60, 60],
revert: 'invalid',
snapMode: 'corner'
});


$('.drop').droppable({
drop: function(event, ui) {
    word = $(this).data('word');

    guesses[word].push($(ui.draggable).attr('data-letter'));
    console.log($(event));
    console.log($(ui.draggable).text());

    console.log('CHECKING : ' + $(this).text() + ' against ' +                  $(ui.draggable).text().trim());


    if ($(this).text() == $(ui.draggable).text().trim()) {

        $(this).addClass('wordglow3');
    } else {
        $(this).addClass('wordglow');
    }
    console.log('CHECKING : ' + $(this).text() + ' against ' + $(ui.draggable).text().trim());


    console.log(guesses);

    if (guesses[word].length == 3) {
        if (guesses[word].join('') == word) {
            $('td[data-word=' + word + ']').addClass('wordglow2');

        } else {
            $('td[data-word=' + word + ']').addClass("wordglow4");
            guesses[word].splice(0, guesses[word].length);
        }
    }






},
  • 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-09T21:54:56+00:00Added an answer on June 9, 2026 at 9:54 pm

    Try this…

    $('.drag').on('click', function(e) {
    e.preventDefault();
    
    var target = $('.drop-box.spellword:not(.occupied):first');
    var targetPos = target.position();
    var currentPos = $(this).offset();
    var b = $(this);
    
    if (target.length) {
        target.addClass("occupied");
        $(".minibutton").prop("disabled", true);
        b.clone().addClass(
        b.data("letter") == target.data("letter") ? "wordglow3" : "wordglow").appendTo("table").css({
            background: "transparent",
            position: "absolute",
            top: currentPos.top,
            left: currentPos.left
        }).animate({
            top: targetPos.top,
            left: targetPos.left
        }, "slow", function() {
            $(this).css({
                top: 0,
                left: 0
            }).appendTo(target);
    
           }); 
    
    
        }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple drag and drop game with jquery's draggable plugin. There are
I want to do a simple drag-drop using jQuery. I have not done anything
I have a drag-and-drop event handler registered to a parent form, this.DragDrop += new
I have a problem with drag and drop event on JFXPanel that on located
I have drag&drop jQuery script for dragging list items to input. How do I
How I can enable the drag and drop event on jlabel ? I have
I have a drag-and-drop functionality in my application using DragDrop event and DoDragDrop method
i have some drag and drop items, which are just draggable vertically within my
I have two li elements which are jQuery draggable. When I drag and drop
I have a drag and drop game that I am now considering changing. Basically

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.