javascript trigger when gif animation is done

空扰寡人 提交于 2019-12-06 08:18:30

Start a timer equal to the GIF duration when the GIF has loaded;

<img onload="redirect();" style="position:absolute;top:0;bottom:80px;right:0;left:0;margin:auto;" src="../images/loading.gif"" width="150" height="150" />

And in the <head> element:

<script type="text/javascript">   
function redirect() 
{  
  window.setTimeout(function() {
    window.location="../index";
  }, 6700);   
} 
</script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!