I’m using the Fancybox plugin for an image gallery, and I want to display the image titles only when the user hovers over the image. I cannot figure out what part of the code to modify in order to accomplish this.
I’ve tried editing the CSS by adding a :hover state to the following:
.fancybox-title-over-wrap {
}
and I’ve even tried playing with the CSS visibility settings here:
.fancybox-opened .fancybox-title {
}
However, I’ve had no luck.
Must I change something within the actual JS file? Any help would be tremendously appreciated!
You don’t need to mess with the original js or css files. You just need to create your own custom script and apply there some fancybox API options and methods to achieve that.
For example, having this html
you would need a custom script to fire fancybox like:
now, within the script above, try the following options for the
titleeffect you want:You could even add some nice animation to show the
titlelikeNOTE: this is fancybox v2.x