Jump to content

ALT tag on FancyBox / ThickBox


Osirion

Recommended Posts

Hey Guys,

So I only just noticed that my (rather old) theme running on 1.6(.0.13 I think) was using jqZoom and the ALT tag on images was the full URL.

I've disabled jqZoom and now I'm getting the proper image caption/legend at the top/gallery.

 

Problem is, since jqZoom is disabled - fancybox takes over - and fancybox has their image code in the footer and THERE the ALT tags are not getting generated. If I click an image, it has the fancybox title at the bottom, however - checking the image of said title = empty:

 

"Large" image code at the top:

<img src="https://www.secondskin.co.za/71-large/damplifier-pro.jpg" alt="Second Skin Damplifier Pro Close Up" title="Second Skin Damplifier Pro Close Up" id="bigpic" width="300" height="300">

"Small" image code at the top:

<img id="thumb_71" src="https://www.secondskin.co.za/71-medium/damplifier-pro.jpg" alt="Second Skin Damplifier Pro Unboxed" title="Second Skin Damplifier Pro Unboxed" height="80" width="80">

Fancybox code at the bottom:

<img class="fancybox-image" src="https://www.secondskin.co.za/71-thickbox/damplifier-pro.jpg" alt="">

Just to repeat, the fancybox caption is showing correctly, so essentially what I'm looking to do is copy the fancybox image caption into the alt tag. Where do I get this done?

 

You can see the product page here:

https://www.secondskin.co.za/vibration-dampers/1-damplifier-pro.html

Edited by Osirion (see edit history)
Link to comment
Share on other sites

Why would you need to create this alt? The fancybox is dynamically generated at the moment someone clicks the view larger button, so for SEO purpose this will never be reached, as the searchengine crawlers don't click...

 

To add it, you probably should add some javascript AFTER creating the fancybox  (i believe this is done in themes/<your theme folder>/js/product.js, but not fully sure) , for example copying it from the #bigpic image 'title' attribute or so, something like this:

 

      var the_alt = $('#bigpic').attr("title");
      $('fancybox-image').attr("alt",the_alt);
 
 
or so. haven't tried it, but expect something like that.
 
But as said, if it solely for SEO purpose, I don't see any benefit here, as the crawlers never meet the fancybox.
 
My 2 cents,
pascal
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...