Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.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 div在循环中隐藏和显示_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript div在循环中隐藏和显示

Javascript div在循环中隐藏和显示,javascript,jquery,html,css,Javascript,Jquery,Html,Css,如何立即创建一个又一个的道路分隔带动画?请查找以下问题示例链接 HTML: <div id="tech-slideshow"> <div id="tech-slideshow-1" class="tech-slideshow-1">dfsd</div> <div id="tech-slideshow-2" class="tech-slideshow-1">dfs</div> <div id="tech-s

如何立即创建一个又一个的道路分隔带动画?请查找以下问题示例链接

HTML

<div id="tech-slideshow">
    <div id="tech-slideshow-1" class="tech-slideshow-1">dfsd</div>
    <div id="tech-slideshow-2" class="tech-slideshow-1">dfs</div>
    <div id="tech-slideshow-3" class="tech-slideshow-1">dfsd</div>
    <div id="tech-slideshow-4" class="tech-slideshow-1">dfs</div>
    <div id="tech-slideshow-5" class="tech-slideshow-1">fsd</div>
    <div id="tech-slideshow-6" class="tech-slideshow-1">dfs</div>
</div>
.devider-marque img.devider {
    margin-top: 0px;
}
#tech-slideshow {
    height: 500px;
    position: absolute;
    overflow: hidden;
    left: 50%;
    width: 50px;
    bottom: 0;
}
#tech-slideshow > div {
    width: 50px;
    background:#000;
    position: absolute;
    top: 0;
    left: 0;
    height: 50px;
}
#tech-slideshow-1 {
    margin-top: -200px;
    -webkit-animation: moveSlideshow1 5s linear infinite;
    -moz-animation: moveSlideshow1 5s linear infinite;
}
#tech-slideshow-2 {
    margin-top: -400px;
    -webkit-animation: moveSlideshow2 5s linear infinite;
    -moz-animation: moveSlideshow1 5s linear infinite;
}
#tech-slideshow-3 {
    margin-top: -600px;
    -webkit-animation: moveSlideshow3 5s linear infinite;
    -moz-animation: moveSlideshow1 5s linear infinite;
}
#tech-slideshow-4 {
    margin-top: -800px;
    -webkit-animation: moveSlideshow4 5s linear infinite;
    -moz-animation: moveSlideshow1 5s linear infinite;
}
#tech-slideshow-5 {
    margin-top: -1000px;
    -webkit-animation: moveSlideshow5 5s linear infinite;
    -moz-animation: moveSlideshow1 5s linear infinite;
}
#tech-slideshow-6 {
    margin-top: -1200px;
    -webkit-animation: moveSlideshow6 5s linear infinite;
    -moz-animation: moveSlideshow1 5s linear infinite;
}
 @-moz-keyframes moveSlideshow1 {
 0% {top:0; height:150px;}
 10% {top:20;height:150px;}
 100% {top:1200px;height:150px;}
}
@-webkit-keyframes moveSlideshow1 {
 0% {top:0; height:150px;}
 10% {top:20;height:150px;}
 100% {top:1200px;height:150px;}
}

可以通过设置动画时间值来控制速度

 -webkit-animation: moveSlideshow6 3s linear infinite;
-moz-animation: moveSlideshow1 3s linear infinite;

你好,这是你的答案

使用过渡延迟,而不是边距顶部

#Anydiv {
     animation-name: moveSlideshow1;
     animation-duration: 5s;
     animation-iteration-count: infinite;
     animation-timing-function: linear;
     animation-delay: 1s; [ adding transition delay +1 to next div in loop will make it smoother ]
}
我刚刚匆忙编辑了小提琴,所以我单独添加了动画参数,您可以使用速记:)

拨弄


希望它能帮助你:)

在你的帖子中添加一些代码,或者这里的人以反对票将其关闭。并解释问题所在。检查我的答案,伙计,它起作用了:)谢谢你的回答。但当我的最后一个div是hide时,我的循环就开始了。我想定期看电视。不间断地。。就像一次又一次的平滑显示一样,检查我的答案,并将其平滑地进行处理:)谢谢你,杜德·克鲁纳尔·潘查……)