Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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 元素不会在某些浏览器中消失_Javascript_Css_Animation - Fatal编程技术网

Javascript 元素不会在某些浏览器中消失

Javascript 元素不会在某些浏览器中消失,javascript,css,animation,Javascript,Css,Animation,简单地说,加载白色背景的动画应该在加载主页时出现。加载完成后,它应该消失。在Chrome上运行良好,但IE和Firefox动画不起作用,但不会消失,这可能与JS有关 ***编辑-我已经暂时删除了html,因为网站是活动的,我们的客户需要 看看这里:www.championfreight.co.nz HTML CSS 啊!!我明白了。但这在Firefox中可能不起作用,因为它们在加载另一个页面时会关闭动画。让动画工作的唯一方法是使用AJAX进行加载。这是一点工作,如果你这样做的话,你可能会在搜索引

简单地说,加载白色背景的动画应该在加载主页时出现。加载完成后,它应该消失。在Chrome上运行良好,但IE和Firefox动画不起作用,但不会消失,这可能与JS有关

***编辑-我已经暂时删除了html,因为网站是活动的,我们的客户需要

看看这里:www.championfreight.co.nz

HTML

CSS


啊!!我明白了。但这在Firefox中可能不起作用,因为它们在加载另一个页面时会关闭动画。让动画工作的唯一方法是使用AJAX进行加载。这是一点工作,如果你这样做的话,你可能会在搜索引擎上遇到问题,因为AJAX不会由搜索引擎运行,你也不会从搜索引擎上得到任何点击,所以这是个坏主意…

你可能会想把;在JavaScript行的末尾。这通常是一个很好的做法。也许只是在这里,它不见了。还还有,白色背景的身体,另一个失踪;。这可能会有帮助,因为不同的浏览器以不同的方式接受这种缺失的行尾…感谢您的帮助!我已经做了改变,但仍然没有运气。仍然在修补。动画效果很好,但我认为整个问题都集中在JS上。它只是在页面加载时不删除动画和白色背景。我想知道该页面提供的其他JS是否会导致问题。探索。尝试过这个-动画现在根本不出现$document.readyfunction{document.getElementByIdfollowingBallsG.style.visibility=hidden;document.getElementByIdbackgroundcolor.style.visibility=hidden;};尝试此-动画不起作用$document.readyfunction{$'followerballsg.hide;$'backgroundcolor.hide;};我想我已经修好了$window.loadfunction{$'followerballsg'.hide;$'backgroundcolor'.hide;};如果你不这么认为,欢迎任何反馈。特别感谢那些帮助过你的人。啊。。。您没有提到可以使用jQuery这一事实。请注意,隐藏使用的是display:none CSS,而不是visibility:hidden。
<div id="backgroundcolor" style="position:fixed; width:100%; height:100%; left:0%; top:0%; z-index:1997">
<div id="followingBallsG" style="left:50%; margin-left:-50px; top:50%; z-index:1998">
<div id="followingBallsG_1" class="followingBallsG">
</div>
<div id="followingBallsG_2" class="followingBallsG">
</div>
<div id="followingBallsG_3" class="followingBallsG">
</div>
<div id="followingBallsG_4" class="followingBallsG">
</div>
</div>
</div>
window.onload = function()
{ 
document.getElementById("followingBallsG").style.visibility = "hidden" 
document.getElementById("backgroundcolor").style.visibility = "hidden" 
}
#backgroundcolor{
background-color:white
}

#followingBallsG{
position:relative;
width:100px;
height:8px;
}

.followingBallsG{
background-color:#000000;
position:absolute;
top:0;
left:0;
width:8px;
height:8px;
-moz-border-radius:4px;
-moz-animation-name:bounce_followingBallsG;
-moz-animation-duration:1.4s;
-moz-animation-iteration-count:infinite;
-moz-animation-direction:linear;
-webkit-border-radius:4px;
-webkit-animation-name:bounce_followingBallsG;
-webkit-animation-duration:1.4s;
-webkit-animation-iteration-count:infinite;
-webkit-animation-direction:linear;
-ms-border-radius:4px;
-ms-animation-name:bounce_followingBallsG;
-ms-animation-duration:1.4s;
-ms-animation-iteration-count:infinite;
-ms-animation-direction:linear;
-o-border-radius:4px;
-o-animation-name:bounce_followingBallsG;
-o-animation-duration:1.4s;
-o-animation-iteration-count:infinite;
-o-animation-direction:linear;
border-radius:4px;
animation-name:bounce_followingBallsG;
animation-duration:1.4s;
animation-iteration-count:infinite;
animation-direction:linear;
}

#followingBallsG_1{
-moz-animation-delay:0s;
}

#followingBallsG_1{
-webkit-animation-delay:0s;
}

#followingBallsG_1{
-ms-animation-delay:0s;
}

#followingBallsG_1{
-o-animation-delay:0s;
}

#followingBallsG_1{
animation-delay:0s;
}

#followingBallsG_2{
-moz-animation-delay:0.14s;
-webkit-animation-delay:0.14s;
-ms-animation-delay:0.14s;
-o-animation-delay:0.14s;
animation-delay:0.14s;
}

#followingBallsG_3{
-moz-animation-delay:0.28s;
-webkit-animation-delay:0.28s;
-ms-animation-delay:0.28s;
-o-animation-delay:0.28s;
animation-delay:0.28s;
}

#followingBallsG_4{
-moz-animation-delay:0.42s;
-webkit-animation-delay:0.42s;
-ms-animation-delay:0.42s;
-o-animation-delay:0.42s;
animation-delay:0.42s;
}

@-moz-keyframes bounce_followingBallsG{
0%{
left:0px;
background-color:#000000;
}

50%{
left:93px;
background-color:#000000;
}

100%{
left:0px;
background-color:#000000;
}

}

@-webkit-keyframes bounce_followingBallsG{
0%{
left:0px;
background-color:#000000;
}

50%{
left:93px;
background-color:#000000;
}

100%{
left:0px;
background-color:#000000;
}

}

@-ms-keyframes bounce_followingBallsG{
0%{
left:0px;
background-color:#000000;
}

50%{
left:93px;
background-color:#000000;
}

100%{
left:0px;
background-color:#000000;
}

}

@-o-keyframes bounce_followingBallsG{
0%{
left:0px;
background-color:#000000;
}

50%{
left:93px;
background-color:#000000;
}

100%{
left:0px;
background-color:#000000;
}

}

@keyframes bounce_followingBallsG{
0%{
left:0px;
background-color:#000000;
}

50%{
left:93px;
background-color:#000000;
}

100%{
left:0px;
background-color:#000000;
}

}