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

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>';
				}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.