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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:17:21+00:00 2026-06-08T12:17:21+00:00

I am creating a word spelling, drag and drop game . When the letters

  • 0

I am creating a word spelling, drag and drop game. When the letters are dragged onto the words in the table, a style is triggered depending on whether the spelling is right or wrong. If it is right the word fades away to reveal the picture behind. If it is wrong the letters glow red as set by the style.

My problem is that the letters stay red throughout the rest of the game, meaning the image behind cannot be completed because you it wont allow you to spell the words glowing red. I need the style to go when the next turn happens and allow you to have another go at spelling that word, can anyone help me with this?

Here is the script that triggers the CSS…

$(".drop").droppable({ 

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

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

    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("wordglow");

        }
    }
}
});

Here is the CSS for this is…

.wordglow {
    -webkit-box-shadow: inset 20px 0px 10px 5px #ff0000;
    box-shadow: inset 0px 0px 10px 5px #ff0000;

}

.drop.wordglow2 {

    -webkit-box-shadow: inset 0px 0px 10px 5px #22ff22;
    box-shadow: inset 0px 0px 10px 5px #22ff22;
    visibility: hidden;
    opacity: 0;


}

I have tried this to enable the wrong answer to be spellable again..

$('td[data-word=' + word + ']').addClass("wordglow").removeAttr('disabled');;
  • 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-08T12:17:22+00:00Added an answer on June 8, 2026 at 12:17 pm

    You can remove the class on the activate event. So when an object is glowing red, the red disappears when you start dragging it to a next position again!

    $(".drop").droppable({ 
        hoverClass: 'drophover',
        drop: function(event, ui) {
            word = $(this).data('word');
    
            guesses[word].push($(ui.draggable).attr('data-letter'));
    
            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("wordglow");
                }
            }
        },
    
        // this event is triggered when a draggable object is activated
        activate: function(event, ui) {
            word = $(this).data('word');
    
            // try to remove the class
            $('td[data-word=' + word + ']').removeClass('wordglow');
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently creating a spelling game where you drag and drop letters onto
I am currently creating a spelling game which is currently drag and drop .
I am creating a word game. I have a list of all the words
I am creating a word game where you have to spell the words in
I am creating a word game where you have to spell the words in
I'm creating word by word coloring tool. Basically user can select few letters from
I am new to programming. I am creating a small word jumble game to
I'm creating a database for a dictionary. Consider the table WORD. My current plan
In the word game I am creating the aim of it is to complete
I'm running into the classic scenario where, when creating Word COM objects in .NET

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.