Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 引导API旋转木马_Javascript_Jquery_Css_Twitter Bootstrap_Carousel - Fatal编程技术网

Javascript 引导API旋转木马

Javascript 引导API旋转木马,javascript,jquery,css,twitter-bootstrap,carousel,Javascript,Jquery,Css,Twitter Bootstrap,Carousel,我一直在使用引导API,也一直在使用旋转木马。我想让两个图像以恒定的运动在页面上“漂移”,下一个图像从右侧开始,然后在页面上缓慢移动,当该图像离开页面时,从右侧开始下一个图像。我不希望图像永远停止。我尝试过使用一些选项,如interval、pause、和wrap,但都没有用。有没有办法用默认的旋转木马来实现这一点 <!-- Carousel --> <div id="this-carousel-id" class="carousel slide">&

我一直在使用引导API,也一直在使用旋转木马。我想让两个图像以恒定的运动在页面上“漂移”,下一个图像从右侧开始,然后在页面上缓慢移动,当该图像离开页面时,从右侧开始下一个图像。我不希望图像永远停止。我尝试过使用一些选项,如
interval
pause
、和
wrap
,但都没有用。有没有办法用默认的旋转木马来实现这一点

<!--  Carousel -->  
        <div id="this-carousel-id" class="carousel slide"><!-- class of slide for animation -->
            <div class="carousel-inner">
                <div class="text-center item active"><!-- class of active since it's the first item -->
                    <img src="<?php realpath($_SERVER["DOCUMENT_ROOT"]); ?>/public_html/img/phone_slide.png" alt="" />
                </div>
                <div class="item">
                    <img src="<?php realpath($_SERVER["DOCUMENT_ROOT"]); ?>/public_html/img/phone_slide.png" alt="" />
                </div>
            </div><!-- /.carousel-inner -->
        </div>
<!-- /Carousel -->

<script>
  $(document).ready(function(){
    $('.carousel').carousel({interval: 500});
  });
</script>

/public_html/img/phone_slide.png“alt=”“/>
/public_html/img/phone_slide.png“alt=”“/>
$(文档).ready(函数(){
$('.carousel').carousel({interval:500});
});

您可以覆盖Bootstrap的CSS,使其使用线性转换,而不是简单的输入输出。您还可以将其持续时间从0.6秒更改为您想要的任何时间。显然,秒数越多,转换时间越长/越慢。您还需要将间隔设置为1,以便旋转木马不会在任何图像上停止


你能粘贴你当前使用的代码吗?这将非常有帮助。当然,只是张贴它。没问题,很高兴这是你要找的!还有一件事,它似乎在某个点上跳跃并重新启动。有时它会平滑滚动3次迭代,4次,有时5次,然后重新加载。知道那里会发生什么吗?@trevorhuto我在Firefox中没有这种经历。我让它运行了大约10次迭代,这对我来说很好。它发生在Safari中,一定是我的代码中的其他东西。我做了18秒的转换,数据间隔为1000(我认为是1秒),它工作得很好,但仍然有一点小故障,这意味着它不时有一点闪烁。。。我试着将数据间隔设为1,但它更加闪亮。。。我做了1800的数据间隔,它在1000到1之间,我会说。。。曾经那么轻微。。。我想知道如何改进。。。我不确定我是否会保留它。。。小毛病太小了,很难决定。。。我试着将它们设置为相同的4s,数据间隔=4000或8和8000,看起来更容易出错。。。
.carousel-inner > .item {
    -webkit-transition: 5s linear left;
    -moz-transition: 5s linear left;
    -o-transition: 5s linear left;
    transition: 5s linear left;
}