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

  • Home
  • SEARCH
  • 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 8147509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:22:40+00:00 2026-06-06T14:22:40+00:00

I’m working on a memory matching game. Right now, the game is working fine.

  • 0

I’m working on a memory matching game. Right now, the game is working fine. However, I now need to work on the part of the game where you actually have to flip the cards over. I first was going to have two sets of images: the “back of the card” and the “front of the card.” The backs of the cards were all going to be identical and then when you click on one, the front of the card would be revealed. The fronts would all be unique pairs of pictures. However, my code is such that pictures that are clicked on which have the same source would be removed. So once you click on any two of the “backs” of the pictures, they would always be removed, regardless of what their “front” was.

I want to use only one set of pictures and just have them displayed differently when they are clicked. Sorry if that sounds a bit confusing, that’s the best way I can explain it.

Here is a demo of what I have so far: http://jsfiddle.net/GquLr/

So basically, I need a way to incorporate a feature where you have to flip two cards over and if they match, they are removed and if they don’t match, they flip back over.

  • 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-06T14:22:42+00:00Added an answer on June 6, 2026 at 2:22 pm

    With displaying both a front and back side of the cards, every card is essentially two images overlayed on top of each other. You can use CSS 3 to flip the back side over as well.

    The way I see it, you can represent that structure in HTML markup with something like the following:

    <div class="card">
        <img class="front" />
        <img class="back" />
    </div>
    

    Using that, you can easily target the elements on what needs to be flipped, et al.

    On the Javascript side, however, the way you’re thinking, I take it is that you’re assigning the click handler on the front <img/>. I’d suggest you move it to the div.card instead. That way you don’t have to worry about which side of the card gets the click.

    From the div.card, you can easily get the source of the front <img/> with something like:

    $('div.card').on('click', function () {
        var _src = $(this).find('.front').attr('src');
    });
    

    … and use that to compare with the other cards in the display.

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

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.