我目前正在一个网站上工作,它使用 jquery ui 选项卡,在每个选项卡中我都实现了 jcarousel,它在第一个选项卡中看起来和工作正常,但是当我切换到第二个或第三个选项卡时,没有 jcarousel功能为什么会这样?这是我的代码,
`$("#related").tabs();`
`$('#complimentary-carousel, #similar-carousel, #viewed-carousel').jcarousel({
scroll : 5,
visible: 5
});`
HTML看起来像这样,
<div id="related" class="clearfix">
<ul class="tabs">
<li><a href="#complimentary">Complimentary</a></li>
<li><a href="#similar">Similar</a></li>
<li><a href="#viewed">Recently Viewed</a></li>
</ul>
<div id="complimentary">
<ul id="complimentary-carousel" class="carousel">
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
</ul>
</div>
<div id="similar">
<ul id="similar-carousel" class="carousel">
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
</ul>
</div>
<div id="viewed">
<ul id="viewed-carousel" class="carousel">
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€50</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
<li>
<a href="">
<img src="assets/img/products/mini-radio.png"/>
<span class="price">€30</span>
</a>
</li>
</ul>
</div>
</div>