You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.
I realized that the caption gets created by either taking the alt or the title attribute into account:
Line 288 in jquery.photobox.js
// if no img child found in the link
if( thumbImg ){
captionlink = thumbImg.getAttribute('data-pb-captionlink');
thumbSrc = thumbImg.getAttribute(that.options.thumbAttr) || thumbImg.getAttribute('src');
caption.content = ( thumbImg.getAttribute('alt') || thumbImg.getAttribute('title') || '');
}
IMO it would make more sense to first look for the title, and if that's not filled out use the alt, as alt attribute is required, title optional. Even better would be an option to configure the desired behaviour:
use alt, then title
use title, then alt
use only alt
use only title
In my use case, I would want to only use title text as caption, but there are surely other possible uses. Is there a way to do this already? Or would you consider this a feasible enhancement?
The text was updated successfully, but these errors were encountered:
well, my original approach was that every person should modify the script to suit their needs, and my job is to make the script as easy to maintain/read as possible so others could easily find the code needed to be changed.
Yeah, I can change it so the title would be looked for first and then the alt attribute, but making the user choose via options seems like there will be no end to the modifications one could do. I get many different requests, and it's not always easy to justify adding custom settings or decide to just leave and and let the users modify it themselves.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I realized that the caption gets created by either taking the alt or the title attribute into account:
Line 288 in jquery.photobox.js
IMO it would make more sense to first look for the title, and if that's not filled out use the alt, as alt attribute is required, title optional. Even better would be an option to configure the desired behaviour:
In my use case, I would want to only use title text as caption, but there are surely other possible uses. Is there a way to do this already? Or would you consider this a feasible enhancement?
The text was updated successfully, but these errors were encountered: