Ok guys, I have edited the question so that you can understand. I have 10 images and their respective name in paragraph. So, you have 10 images and 10 paragraphs. As the images
Your code should be something like that if i correctly understand your question.
So, if i get it, you can do something like that, assuming you add a class (lets say myimgclass) to all your images you want to check:
Your code should be something like that if i correctly understand your question.
So, if i get it, you can do something like that, assuming you add a class (lets say myimgclass) to all your images you want to check:
$(document).ready(function() {
$('.myimgclass').click(function() {
//hide >>name here<<
$(this).hide('slow', function() {
var check = true;
$('.myimgclass').each(function() {
//we check if image is visible, if so we stop here
if($(this).is(':visible')) {
check = false;
return;
}
});
if(check) alert('Hello');
});
});
});
See http://jsfiddle.net/s7FXR/