bxSlider won't allow HTML text within slides

谁说胖子不能爱 提交于 2020-02-25 17:08:11

问题


I want each slide to have an image on the left and text sitting to the right of it, but it just won't work. The slider works just fine when there are only images but as soon as I add a single letter, the whole slider breaks.

Am I missing something or does bxSlider not allow plain old HTML text?

Thanks.


回答1:


You can use divs instead of li tags to order your slides. Here is an example with Foundation 5 Framework applied to the slider simply to generate rows/columns.

<div class="bxslider">
<div class="row collapse slide-pane">
    <div class="small-6 medium-6 large-6 columns">
        <img src="http://placehold.it/350x250/5E7074/FFFFFF&text=Slide-One" />
    </div>
    <div class="small-6 medium-6 large-6 columns text-pane">       
<h1>Are you ready for the truth?</h1>
    </div>
</div>
<div class="row collapse slide-pane">
    <div class="small-6 medium-6 large-6 columns">
        <img src="http://placehold.it/350x250/5E7074/FFFFFF&text=Slide-Two" />
    </div>
    <div class="small-6 medium-6 large-6 columns text-pane">       
<h1>Are you ready for the truth?</h1>
    </div>
</div>
<div class="row collapse slide-pane">
    <div class="small-6 medium-6 large-6 columns">
        <img src="http://placehold.it/350x250/5E7074/FFFFFF&text=Slide-Three" />
    </div>
    <div class="small-6 medium-6 large-6 columns text-pane">          
<h1>Are you ready for the truth?</h1>
    </div>
</div>

Fiddle: http://jsfiddle.net/defonic/E8NgR/



来源:https://stackoverflow.com/questions/20488330/bxslider-wont-allow-html-text-within-slides

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!