Matching different images
hi, i am trying to match images. this one works fine only with same images but i want to match unidentical images based on their id or src
below is the working code for similar images
can u help me the code with different images based on the image id or src. i am trying to do but i cant get it. plz help me with...
This should be easy. Just remove your code on lines 9-11. Then we check if the id's first character is the same as the last image clicked id's first character.
Since you made the first IDs 1a, 2a, and 3a, and the second IDs 1b, 2b, and 3b, it's easy to detect when they are the same.
1a will be the same as 1b, if you designed the html correctly (which you didn't, somewhat).
Here is the small change I made: http://jsfiddle.net/thetenfold/kRz59/
To demonstrate the change, you can change the 1b image's src to anything you want, but it will always match up with 1a (and even 1c, 1d, etc).
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)