For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 7 replies, 2 voices, and was last updated 12 years, 5 months ago by
adikate.
-
AuthorPosts
-
adikateMemberis 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…
July 5, 2013 at 8:46 am #340606
BrandonMemberCheck out the Resemble js it can do what you need:
http://huddle.github.io/Resemble.js/July 5, 2013 at 12:31 pm #340618
adikateMembersorry 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.
July 6, 2013 at 9:18 am #340630
BrandonMemberIm 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?
July 8, 2013 at 7:11 am #340651
adikateMemberyes 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….July 8, 2013 at 9:04 am #340653
BrandonMemberI 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;
}
}July 8, 2013 at 10:06 am #340656
adikateMemberSorrry 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
July 9, 2013 at 10:57 am #340689
adikateMemberSorrry 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
-
AuthorPosts
