Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Thumbnail images with expanded view Reply To: Thumbnail images with expanded view

#240347
henryvuong
Participant

The script seems to work, but the first image preview does not actually disappear when I click on second or third thumbnail. It’s just hidden under the second or third image, but it’s still there. You can see the effect if you swap the position of the first image with any of the other two, part of it will be visible when you click on the other thumbnails.

Someone helped me come up with this script:

http://codepen.io/henryvuong/pen/MyQgro

This script works for me. But I would like to ask if you can help me do one more thing: make a thumbnail disappear if the image does not exist. Most of my auctions have 3 photos, but some have 2 or 1. If I use this script on an auction that only has 2 photos, the third thumbnail will appear as a broken image link.

I use a software to manage my eBay auctions and this script is embedded in a template for all auctions, so if an auction has less than 3 images, it still display 3 thumbnails, with the missing thumbnails being displayed as broken image icon.

Can you modify the script to make a broken image icon automatically disappear? In my original JavaScript posted above, it is taken care of, but without JavaScript it must be done with CSS. My temporary solution is to add “alt = no image” attribute to img tag to let viewer know that the image does not exist, but it would be better to make it disappear instead.