Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'captionsAttr' options in order customize image caption value #965

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enrico-sorcinelli
Copy link

This simple PR adds captionsAttr option in order to customize img attribute from which to get the caption value. Default value is title (that is, as the current behaviour).
For example:

JS

$('.bxslider').bxSlider({
   mode: 'fade',
   captions: true,
   captionsAttr: 'data-caption'
});

HTML

<ul class="bxslider">
  <li><img src="/images/730_200/tree_root.jpg" title="Funky roots" data-caption="Source: Thinkstock" /></li>
  <li><img src="/images/730_200/hill_road.jpg" title="The long and winding road" data-caption="Source: Flickr" /></li>
  <li><img src="/images/730_200/trees.jpg" title="Happy trees" data-caption="Source: Getty Images" /></li>
</ul>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant