Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm using fancybox 2 with the following code (demo here):

<a class="fancybox" 
href="http://a.com/bmw-328-manual-2008-black-18-inch-rims.jpg" 
title"bmw 328 manual 2008 black 18 inch rims">
<img alt="bmw 328 manual 2008 black 18 inch rims"
src="http://a.com/bmw-328-manual-2008-black-18-inch-rims-s.jpg" />
</a>

<div class="hidden">
<a class="fancybox" 
href="http://a.com/bmw-328-manual-2008-black-18-inch-rims.jpg" 
title"bmw 328 manual 2008 black 18 inch rims">
<img alt="bmw 328 manual 2008 black 18 inch rims"
src="http://a.com/bmw-328-manual-2008-black-18-inch-rims-s.jpg" />
</a>

<a class="fancybox" 
href="http://a.com/bmw-328-manual-2008-black-18-inch-rims.jpg" 
title"bmw 328 manual 2008 black 18 inch rims">
<img alt="bmw 328 manual 2008 black 18 inch rims"
src="http://a.com/bmw-328-manual-2008-black-18-inch-rims-s.jpg" />
</a>
</div>

As you can see, the first image is visible, the 2 others are only visible when the first one is clicked on, this triggers fancybox to start:

$(".fancybox")
.attr('rel', 'gallery')
.fancybox({
    padding : 0
});

With the CSS:

.hidden {
display: none;

}

A question here addresses something that concerns me. The main difference is that I use words in the file name, alt tag and title tag to describe the item.

The title is displayed by fancybox when triggered.

I wonder if this would look like spam to search engines, would it?

share|improve this question
2  
Using rel="gallery" will fail w3c validation by the way. –  bybe May 14 '13 at 20:41
add comment

2 Answers

up vote 3 down vote accepted

No you shouldn't concern yourself, it makes perfect user sense.

If you want to be nice to those with javascript disabled though you could place a <noscript> element with your hidden images.

I would also put the photo numbers in the alt tags, something like alt="Photo #2 of bmw 328 manual 2008 black 18 inch rims"

share|improve this answer
    
Thanks for the answer Anthony. Yes sure, that was just an example, the website is actually not about cars. –  guisasso May 14 '13 at 19:46
add comment

Google reads content within a element that uses display:none, it also checks to make sure there is a trigger point, i.e that the content can be revealed though JavaScript.

Many people don't put in trust in Google being able to understand their scripts and many people opt to use <noscript> as Anthony has mentioned, using noscript ensures that Google doesn't can reveal the data without the need of a trigger. Content that has no triggers can be punished by Google since so many people have hidden content for manipulation of search results. By using <noscript> its a win win situation since Google will 100% see the content with no problems and also has the benefit of users that disabled JavaScript can view the page.

While its a minor issue using rel=" " will fail validation as it was never designed to act as a hook, you should opt to use data-fancybox-group=" " Which I believe is included in fancybox v2 and above.

Furthermore

As far as us SEO'ers are lend to believe Google currently does not take the title tag into account. Personally I'd not use the title tag at all and have a caption as well as a ALT tag, these should be different from one another. This way your provide text content to go with your images which should in turn give better SEO content wise as well as giving Google more signals to rank the image on their image search platform.

Treat ALT tag as a short description, and a caption with more in-depth information in regards of the image, Google is good at grouping the elements to tie them together which will improve SEO. Believe is a example of the code:

<div class="myfancybox">
    <a class="fancybox" href="cat-being-sick.jpg">
        <img src="cat-being-sick-small.jpg" alt="a Cat being sick" />
        <div class="caption">Feeding your cat rice will make your cat sick</div>
    </a>
</div>
share|improve this answer
    
Thanks for the answer bybe. –  guisasso May 15 '13 at 14:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.