Skip to content

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