问题
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