jquery - fancybox and wordpress: image titles -
I should work well with WordPress without the plugin, but I am struggling with the image title.
Fancybox is showing in the anchor for the title but WordPress puts the title in the IMG.
I have seen all the workings and tried to solve all stack overflow, but nothing is working.
I think there are two options: 1. Tell the fancy box to use the IGG title (or alt) instead of the anchor title 2. Run a function to remove the attached title and it will be in anchor Insert
There are many solutions around it, but I am clearly doing something wrong.
Any suggestions?
You can use to
& lt; Img & gt; Callback of faxbox like can get value of
alt or
title attributes in the tag:
$ ("Fancybox"). Get Fancybox ({beforeShow: function () {// Option 1 // Get the title from "Alt" attribute to this.title = $ (this.element) .find ("img"). Attr ("alt"); // Get title from title "title" in option 2 // IGG tag // this.title = $ (this.element) .find ("img"). Attr ("title");}}); View
Comments
Post a Comment