javascript在页面之间淡出

时间:2016-12-07 11:07:28

标签: javascript jquery html css

首先,我对JS很新。我是一个网站,它有一个介绍。此介绍动画必须放在不同的页面中,在结束后,下一个网页将自动加载。

<body onload="setTimeout(
function(){
    window.location.href = 'file:///C:/Users/skatto/Desktop/art%20contest/art_contest_page.html';
}, 32000 )">

这是我在html文件中使用的脚本自动加载下一页, 但它很漂亮&#39;粗糙的,我怎么能添加一个淡入淡出的动画?为了让它更顺畅

2 个答案:

答案 0 :(得分:0)

一个简单的CSS就可以做到这一点。为什么使用脚本?在加载前将动画fadeIn添加到要淡入的任何页面主体。

body {
  animation: fadeIn 0.5s linear;
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
<div>
  Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>Something
  <br/>
</div>

答案 1 :(得分:0)

试试这个

第1页

i // this is already wrong for being single
for i in input_shape //that's correct for cicle
    if i is not None //ugh... so, and what if?
相关问题