带有bxslider的javaScript / HTML -Captions

时间:2014-12-25 16:52:53

标签: javascript html bxslider

我使用bxslider作为我的模板。  我必须在每张图片中显示图片底部的标题。

<ul class="bxslider">
                    <pictures:each bean="${bean}" companyType="${companyType }" pictureList="${pictureList }">
                        <g:if test = "${picture.getLargeImageURL() != null && picture.getThumbnailImageURL() != null}">
                            <li>
                                    <img style="height: 240px; width: 100%"  src="${picture.getLargeImageURL()}" alt="${picture.copyright.copyrightify()}" title="${picture.caption.linkify()}"/>
                            </li>
                        </g:if>
                        <g:elseif test="${largeFileName != null && thumbnailFileName != null }">
                            <li>
                                    <img src="${resource(dir:'imgService',file:largeFileName)}" style="height: 240px; width: 100%" alt="${picture.copyright.copyrightify()}" title="${picture.caption.linkify()}"/>
                            </li>
                        </g:elseif>
                    </pictures:each>
                </ul>

如何显示标题?

1 个答案:

答案 0 :(得分:0)

http://bxslider.com/examples/image-slideshow-captions

调用bxslider时只需添加以下属性:

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