Wordpress Gallery using alt tags as pic captions instead of title tags
Okay,here's my challenge. I set up a Next Gen image gallery in Wordpress. When you click on an image it enlarges and has a caption underneath it, which is taken from its title tag. My client doesn't like how when you roll over an image in the gallery a tooltip shows up with the image's descritpion, which is also from the title tag. But he still wants the image description to show up as the caption when you click on the image and enlarge it.
Here is a link to a page in the site, if you roll over the first image in the gallery, you'll see what I'm talking about and hopefully it'll make sense. http://mbigelowphotographer.com/wp/engagements
I've tried to find ways on hiding browser default tooltips but I've had no luck. So I thought of placing the image's description in the images alt tag instead of the title tag. Which is fine, I took care of that in the gallery.php file.
But now I can't figure out where in the java script file,shutter-reloaded.js, for the image caption to pull the alt tag instead of the title tag. I've played around in this file for awhile and I believe that's what controls/triggers it. I can
Or maybe I'm way off and it's not in that js file. Any help would be appreciated. Thanks in advance.
it would seem to me that the description gets set here:
NavBar = '<div id="shTitle"><div id="shPrev">' + prevlink + '</div><div id="shNext">' + nextlink + '</div><div id="shName">' + shutterLinks[ln].title + '</div>' + imgNum + '</div>';
and shutterLinks[ln].title gets set here:
so my wild swing at it would be to change that line to
T = ( L.title && L.title != shfile ) ? L.title : '';
T = ( L.alt && L.alt != shfile ) ? L.alt : '';
Thanks for taking a look at it! I tried your suggestion and unfortunately it didn't work.
It must have something to do with it though. Because when I did make that change the pic caption disappeared all together. It just didn't swap it with the alt.
So you are probably on to something or pointed in a good direction.
You were right, it had to do with that line of code. Its just that instead of just switching it to alt, I had to add in these two lines of code,
var linkAlt = jQuery(L).attr('alt');
T = ( linkAlt && linkAlt != shfile ) ? linkAlt : '';
(I had this posted on another forum and someone there provided me with this helpful info)
Thanks again for taking a shot at it. Take care and happy new year.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)