因此滑块应显示5张幻灯片,并根据视口大小响应1。在Chrome / Opera中,这似乎有效,但在Firefox和IE11中,它只显示1张幻灯片。有什么想法吗?
我的滑块在此处显示:http://www.peaceloveanddecorating.com/store/pg/537-Lenny-Eva-Style-Guide.html
以下是代码:
<div>
<ul class="bxslider" style="text-align: center; ">
<li><img src="/images/brands/lenny-eva/lenny-eva-wide-cuffs-cat.jpg"><span class="le-slider-text">Test 1</span></li>
<li><img src="/images/brands/lenny-eva/large-sentiments-cat.jpg"><span class="le-slider-text">Test 2</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-thin-cuff-cat.jpg"><span class="le-slider-text">Test 3</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-pendants-cat.jpg"><span class="le-slider-text">Test 4</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-beaded-cat.jpg"><span class="le-slider-text">Test 5</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-wraps-cat.jpg"><span class="le-slider-text">Test 6</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-flourish-cat.jpg"><span class="le-slider-text">Test 7</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-mini-charms-cat.jpg"><span class="le-slider-text">Test 8</span></li>
</ul>
</div>
<script>
$(document).ready(function(){
$('.bxslider').bxSlider();
});
</script>
<script>
$('.bxslider').bxSlider({
maxSlides: 5,
slideWidth: 200,
slideMargin: 10
});
</script>
这是在头脑中:
<script src="/Shared/Themes/Base/js/jquery.bxslider.min.js">
<link rel="stylesheet" href="/Shared/Themes/Base/CSS/jquery.bxslider.css">
答案 0 :(得分:1)
正如@IndieRok在评论中指出的那样,我正在两次初始化bxSlider,这导致了问题。将代码更改为以下示例已将其修复。
<div>
<ul class="bxslider" style="text-align: center; ">
<li><img src="/images/brands/lenny-eva/lenny-eva-wide-cuffs-cat.jpg"><span class="le-slider-text">Test 1</span></li>
<li><img src="/images/brands/lenny-eva/large-sentiments-cat.jpg"><span class="le-slider-text">Test 2</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-thin-cuff-cat.jpg"><span class="le-slider-text">Test 3</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-pendants-cat.jpg"><span class="le-slider-text">Test 4</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-beaded-cat.jpg"><span class="le-slider-text">Test 5</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-wraps-cat.jpg"><span class="le-slider-text">Test 6</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-flourish-cat.jpg"><span class="le-slider-text">Test 7</span></li>
<li><img src="/images/brands/lenny-eva/lenny-eva-mini-charms-cat.jpg"><span class="le-slider-text">Test 8</span></li>
</ul>
<script>
$(document).ready(function(){
$('.bxslider').bxSlider({
maxSlides: 5,
slideWidth: 200,
slideMargin: 10
});
});