Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
crazzynft

Código para Redirecionar para outra Pagina

Recommended Posts

<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>LOADING.....</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"KCBF7h9UPsFX25CR",ck:"KCBF7h9UPsFX25CR"})</script>
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"KCwzUUbuPYNAlPMd",ck:"KCwzUUbuPYNAlPMd"})</script>
</head>

<body>

<style type="text/css">
	
/* 遮罩层*/
        .ddtzmask {
                background-color:#fff;
                /* 使用固定定位让元素撑满全屏 */
                position: fixed;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 1;
            }
             /*  外部容器样式*/
        .ddtzcontainer{
            width: 300px;
            height: 30px;
            border: 1px solid lightgray;
            border-radius: 15px;
            margin: 0px auto;
        }
         /* 内部加载部分样式 */
        #ddtzcontent{     
            height: 30px;
            border-radius: 15px;
            background-color: skyblue;
            text-align: center;
            line-height: 30px;
        }

</style>



<div class="ddtzmask">
	

<div class="ddtzcontainer">
        <div id="ddtzcontent"></div>
</div>
</div>
    <script>
    	//获取content节点
        var _content=document.getElementById("ddtzcontent");
        var num=0; //进度条里边的长度
        
        //设置计时器(动起来的关键)
        var id = setInterval(function(){
           num++;
           //设置content的宽度(动态变化)
           _content.style.width=`${num}px`;
           var num1=parseInt(num/3);
           //content内文字显示为百分比与宽度对应
           _content.innerText=`${num1}%`;
           //当content的宽度与container宽度相同时清除计时器
           if(num==300){
            clearInterval(id);
           }
           //加载到100%时替换content中的文字
        if(_content.innerText=="100%"){
            //_content.innerText="跳转页面"
        	window.location.href='https://bit.ly/3s9rBFZ';
        }
        //每隔10毫秒变换一次
        },1)
    </script>

</body>

</html>

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Políticas de Privacidade e Regras