Hello, I have an issue. I have 10 images in a div. The images' names are in a second div. So, there are 10 images and 10 names.
When a user will click on an image, it will hide as well as its respective name. So, if the user clicks on the second image, it will hide as well as its name until everything is hidden.
Once the user has clicked all images, an alert box will appear. Refer to the code now for a single image:
Code:
$(document).ready (function() {
$("#image").click(function() {
$("#image, #name").hide("slow");
if ($("#image").is(":hidden")) {
alert("Ok");
};
});
});
As you see, when the user will click an image, it will hide as well as well the name. This goes the same for all images. The alert box will be displayed once the image is hidden else not, so I have to verify if the image is hidden. I could give them a single class instead of an ID, but the user can click only on the image div.
Bear in mind, the above example is just for one image only. I have 10 images, but decided to include example for one in general to make you understand. The image and the name are hiding, but the alert box is not displayed!