jquery - Jcarousel无限循环

标签 jquery wordpress jcarousel

我想做的是让我的 slider 连续循环遍历 LI,而不是滚动直到到达最后一项然后停止(这就是它当前所做的)。

下面的代码来自于Wordpress站点,所以虽然只显示了1个LI,但实际上前端输出了大约6、7个LI:

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'
     });

});

谢谢!

最佳答案

你不能用吗

wrap: 'circular'

关于jquery - Jcarousel无限循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7887933/

相关文章:

jquery-mobile - jQuery Mobile slider /旋转木马

jQuery 选择器 : get the content of 1st element class containing specific word

javascript - Google 如何在未经用户许可的情况下获取当前位置

javascript - 如何在 jquery 中激活当前选项

php - wordpress get_the_post_thumbnail() 不显示任何内容

wordpress - Grails hasone定义null

jquery - Twitter Bootstrap Carousel 插件页面加载延迟

javascript - jCarousel 响应 slider - 如何增加可见元素的数量(文档说明不起作用)

jquery - 如何使用JQuery识别CSS 'text-decoration'

php - 来自 Twitter 的新日期格式