我想要做的是讓我的滑塊不斷循環通過LIs,而不是滾動,直到它到達最後一個項目,然後停止(這是它目前的做法)。Jcarousel無限循環
下面的代碼是從一個WordPress網站,所以儘管它僅顯示一個LI,有INFACT約6或在前端輸出的7:
PHP
<ul id="slideshowContainer" class="jcarousel jcarousel-skin-tango">
<?php $clientLogos = new WP_Query(array('post_type' => 'client-logos', 'posts_per_page' => -1)); ?>
<?php while ($clientLogos->have_posts()) : $clientLogos->the_post(); ?>
<li>
<?php if (has_post_thumbnail($post->ID)): ?>
<?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); ?>
<img src="<?php bloginfo('template_directory'); ?>/thumbs.php?src=<?php echo $image[0]; ?>&h=100&zc=1" alt="<?php the_title(); ?>" />
<?php endif; ?>
</li>
<?php endwhile;?>
<div style="clear:both"></div>
</ul>
JS
jQuery(document).ready(function() {
jQuery('#slideshowContainer').jcarousel({
scroll: 1,
auto: .01,
wrap: 'last',
easing: 'linear'
});
});
謝謝!
不知道問題的海報怎麼不理接受這個答案;) – IFightCode
'包裝:「both''對我的作品 – 907th
http://sorgalla.com/jcarousel/docs/ reference/configuration.html#wrap也許你只是無法拼寫'circular'? – Hazza