我在 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>
如果您查看源代码并单击图像,它们就在那里,网址很好。这是愚蠢的事情吗?