How to hide an image thumbnail when the image is not available in galleriffic

300 views Asked by At

Ive looked all over for an answer to this question...

I am using the Galleriffic plugin on my website to display a gallery of images and i want to be able to change the images by just dropping them in a folder.

My problem is that if there is no image file to be displayed then a default missing photo image is there. I think it looks untidy/unprofessional.

So is there a way to hide the image if the file is unavailable?

I have tried this:

$("img").error(function () { 
$(this).hide();
});

That got rid of the missing photo image but the class"thumb" container was still visible.

I then tried:

$("img").error(function () { 
$("thumb").hide();

});

But that removed all the thumbnails if one image was missing.

Let me know if this makes sense, if not ill try explain it better.

The page I'm working on is here: http://grahamsmotorcycles.co.uk/beta/stock/bike2.html

Thanks in advance for any help.

Stephen

1

There are 1 answers

1
Ahmadbaba46 On BEST ANSWER

Why dont you use $(this).parents('.thumb').remove() instead of $(this).hide()