使用以下代码,我会获得“#featured-carousel”的内容淡入和淡出幻灯片2,3等。
但是,不适用于第一张幻灯片
即使第一次幻灯片第一次淡入淡出,我该如何获得?淡入淡出Twitter中每张幻灯片的内容Bootstrap Carousel
<script type="text/javascript">
jQuery(document).ready(function($) {
var color = "<?=$color?>";
var header_color = "<?=$header_color?>";
$('#featured-carousel').bind('slide', function() {
$(".carousel-caption").animate({'opacity': 0}, 500).delay(2000);
$(".item img").animate({'opacity': 1}, 500).delay(2000);
$(".carousel-caption").animate({'opacity': 1}, 500).delay(2000);
$(".item img").animate({'opacity': 0.2}, 500).delay(2000);
});
$('#featured-carousel').carousel({
interval: 6000,
cycle: true,
});
});
</script>
谢谢你,谢尔布罗。你的代码完全按照我的意愿去做! – Kristoffer
谢谢..真的。您可以在http://demo.theme.firmasite.com/上查看修改后的版本 –