1

我在 wordpress 主题中使用这个jQuery Carousel来显示几个横幅图像。我选择这个脚本是因为我不是一个可靠的 js 编码器并且需要自动实例化的分页。你可以在http://bfc.ravennainteractive.com看到这个问题的一个例子。它显示了第一张图像。有三个可用的图像,它列出了 3 个分页项,但图像 2 和 3 只显示黑色背景。

jQuery(document).ready(function(){
            jQuery("div.hero").carousel({
                loop: true,
                pagination: true,
                autoSlide: true,
                autoSlideInterval: 5000,
                dispItems: 1

            });
    });
    <div class="hero">
        <ul>
                <?php query_posts('category_name=header');?>
                <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <li>
                        <?php $header_image = get_post_meta($post->ID, 'header_image', true); ?>
                        <a href="<?php the_permalink() ?>"><img width="930" height="365" src="<?php echo $header_image; ?>" /></a>
                    </li>
                <?php endwhile; else: ?>
                <?php endif; wp_reset_query(); ?>       
         </ul>
</div>

如果您查看源代码并单击图像,它们就在那里,网址很好。这是愚蠢的事情吗?

4

1 回答 1

0

感谢您的评论。使用这个特定的轮播,.hero 类继续包含 div。但是我终于发现我的问题是基于 css 的。我没有将 li 设置为 display:inline。

非常感谢

于 2010-11-09T16:01:02.927 回答