0

Hi,

I have a page using Moo Tools with 4 images. What I would like to do is to pass a boolean value to an array that exists outside of the image, but then I need to test to see if all elements outside the array are true. If so then I want to alert the user.

Julian

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by julianmoors
0

Hi,

I have a page using Moo Tools with 4 images. What I would like to do is to pass a boolean value to an array that exists outside of the image, but then I need to test to see if all elements outside the array are true. If so then I want to alert the user.

Julian

I've solved it. It's not elegant, but it works. I used the dollars function to select all images with a certain class and compared the src property with a long string. For example:

if ( $$('img.swappable').getProperty('src') == 'images/starcard/swapped/1-3.gif,images/starcard/swapped/1-4.gif,images/starcard/swapped/2-4.gif,images/starcard/swapped/3-4.gif' ) {
					$('message').innerHTML = '<p style="margin:0px;padding-top:10px;font-size:1.2em;">Congratulations!<br />You have managed to collect all cards in this series!</p>';
				}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.