自动跳转页面

1 篇文章 0 订阅

3秒自动跳转到指定页面

<!DOCTYPE html>
<!-- saved from url=(0045)https://www.dezhong365.com/invest/detail/4664 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>提示页面</title>
<meta name="author" content="">
<link href="https://www.dezhong365.com/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="./提示页面_files/404.css">
<script type="text/javascript">
function countDown(secs,surl){     
    var jumpTo = document.getElementById('jumpTo');
    jumpTo.innerHTML=secs;  
    if(--secs>0){     
        setTimeout("countDown("+secs+",'"+surl+"')",1000);     
     }     
    else{       
        location.href=surl;     
     }     
}     
</script>
<style type="text/css">
body{
        font-family: Microsoft Yahei, sans-serif;
    }
</style>
</head>
<body>
  <div class="w1100 cont">
        <div style="margin:80px;"><img src="./提示页面_files/success.png" width="150" height="150"></div>
        <h2>主机发票分票成功</h2>
        <p>页面将在<span class="second" id="jumpTo">3</span>秒后跳转百度</p>
   </div>
   <script type="text/javascript">countDown(3,'http://www.baidu.com/');</script>
</body>
</html>

404.css

@charset "utf-8";
.cont{
    text-align:center;
    min-height:400px;
    }
.cont h2{
    font-weight:normal;
    }   
.cont p{
    padding-top:20px;
    }   
.cont a{
    color:#F30;
    margin-left:20px;
    }   
.cont p span{
    padding:0 5px;
    }   

图片
这里写图片描述

效果图

这里写图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
layui table是一款基于layui框架的表格组件,它提供了丰富的功能和灵活的配置选项。要实现自动跳转页面,可以通过监听表格的行点击事件,然后在事件回调函数中进行页面跳转操作。 以下是实现自动跳转页面的步骤: 1. 在HTML页面中引入layui和jQuery库,并初始化layui组件。 2. 创建一个表格,并设置需要展示的列和数据。 3. 给表格添加行点击事件监听器,当用户点击某一行时触发事件。 4. 在事件回调函数中获取点击行的数据,并根据需要进行页面跳转操作。 下面是一个示例代码,演示如何使用layui table实现自动跳转页面: ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>layui table自动跳转页面</title> <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.5.6/css/layui.css"> <script src="https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/layui/2.5.6/layui.js"></script> </head> <body> <table id="demo" lay-filter="test"></table> <script> layui.use(['table'], function(){ var table = layui.table; // 渲染表格 table.render({ elem: '#demo', url: '/api/getData', // 数据接口 cols: [[ {field: 'id', title: 'ID'}, {field: 'name', title: '姓名'}, {field: 'age', title: '年龄'} ]], page: true }); // 监听行点击事件 table.on('row(test)', function(obj){ var data = obj.data; // 获取点击行的数据 // 根据需要进行页面跳转操作,例如跳转到详情页 window.location.href = '/detail?id=' + data.id; }); }); </script> </body> </html> ``` 在上述示例代码中,我们使用了layui的table组件来渲染表格,并通过监听行点击事件实现了自动跳转页面的功能。当用户点击某一行时,会获取到该行的数据,并根据需要进行页面跳转操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值