# html-loading-animation **Repository Path**: guoliwei139/html-loading-animation ## Basic Information - **Project Name**: html-loading-animation - **Description**: html页面加载的动画效果 - **Primary Language**: HTML - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2018-12-29 - **Last Updated**: 2024-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # html-loading-animation #### 介绍 直接拷贝页面中id为loading的div模块和原有页面中的样式到新页面即可 function load() { var a = setTimeout("loading.style.transition='opacity 0.3s'", 0) //设置透明度改变的过渡时间为0.3秒 var b = setTimeout("loading.style.opacity=0", 0) //0.5秒后加载动画开始变为透明 var c = setTimeout("loading.style.display='none'", 500) //当透明度为0的时候,隐藏掉它 } 给新页面的body上添加 onload="load()" 即可实现页面加载前的动画效果