facebook

Matching two unidentical images

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #340604 Reply

    adikate
    Member

    is there a way to match two different images with html or javascript. i know how to do similar or identical images but i need to match two unidentical or different images…

    for example : if image x, y are nonidentical then i need both of the images to hide…

    #340606 Reply

    Brandon
    Member

    Check out the Resemble js it can do what you need:
    http://huddle.github.io/Resemble.js/

    #340618 Reply

    adikate
    Member

    sorry to say… its just showing the percentage of resemblance. wat i need is by clicking image x,y both images should vanish. if i click only on x or y image should not vanish.

    #340630 Reply

    Brandon
    Member

    Im not sure if I understand correctly. So you dont need a script that compares them, you need a script to know if they were both clicked on or not?

    #340651 Reply

    adikate
    Member

    yes u r correct. hope u understand what i need to do.. i can give u an example of my project of how its gonna be done

    ex: i got so many images with their ids 1,2,… and a,b,… and wat i need is
    if i click on image id 1,a both images should vanish and if i click on 1,b it should say with an alert not a correct selection…

    so matching images id is my main agenda

    image id 1 with image id a
    image id 2 with image id b
    and so on….

    #340653 Reply

    Brandon
    Member

    I would use two variables. (untested code, writing out of my head as Im not on my dev system)
    var image1int = 0;
    var image2int = 0;

    Then in the click use something like:

    //for image 1 first click
    if (image1int == 0 )
    {
    image1int = 1; //replace with the number you want to match
    }

    //image2 first click
    if (image2int == 0 )
    {
    image2int = 1;//replace with the number you wan to match
    }

    //function to check matching
    function matchImage()
    {
    if(image1int == image2int) //image matches
    {
    //hide both images
    $(‘#m1-yourscreen-image1′)css.’visibility’,’hidden’);
    $(‘#m1-yourscreen-image2′)css.’visibility’,’hidden’);
    }else
    {
    //images do not match, reset variables
    image1int = 0;
    image2int = 0;
    }
    }

    #340656 Reply

    adikate
    Member

    Sorrry to say that its my mistake to give much details. you misunderstood with what i say..below is brief explaination of what i do

    i got so many images with their ids 1.jpg, 2.jpg,… and a.jpg, b.jpg,… and wat i need is
    if i click on image id 1.jpg , a.jpg both images should vanish and if i click on 1.jpg , b.jpg it should say with an alert not a correct selection…

    so matching images id is my main agenda

    image id 1.jpg with image id a.jpg
    image id 2.jpg with image id b.jpg
    image id 3.jpg with image id c.jpg
    and so on….

    Kind regards

    #340689 Reply

    adikate
    Member

    Sorrry to say that its my mistake to make misunderstood with what i say..below is brief explaination of what i do

    i got so many images with their ids 1.jpg, 2.jpg,… and a.jpg, b.jpg,… and wat i need is
    if i click on image id 1.jpg , a.jpg both images should vanish and if i click on 1.jpg , b.jpg it should say with an alert not a correct selection…

    So Matching images id is my main agenda

    image id 1.jpg with image id a.jpg
    image id 2.jpg with image id b.jpg
    image id 3.jpg with image id c.jpg
    and so on….

    Kind regards

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Matching two unidentical images

You must be logged in to post in the forum log in