Streamline and syntax questions.
Date: 04/24/05
(Javascript Community) Keywords: no keywords
I'm not very good at this, so bare with me.
I have been trying to figure this meaningless puzzle out and I will not stop until I you figure it out for me! ;)
I am making a puzzle that has 7 pictures, 6 of them are pics when arranged correctly will make the desired picture, the other pic is of a blank. each time you press a picture other than the blank, it will switch positions with the blank. when all are arranged correctly the pictures should revert back to scrambled form.
I have it so it works, but the code is really huge. I need a way to figure out how I can get the image object like here. That way I think I could make a for statement that would make the code much, much smaller. (You'll see!)
Then I need to figure out the proper way to use the if && operand. That is if I can use it for the purpose I intended to use it for, everywhere I looked it was only used twice.
Here are the pictures in case you want to see how it works.
If I can figure out how to get the image object I can eliminate 5 of them functions.
I think getElementById(id); might solve the problem as someone suggested before, but I thought it was a function. I'm reading about it now.
Thanks!
Source: http://www.livejournal.com/community/javascript/64178.html