JS-PC版的404页面

本文介绍如何使用JavaScript技术创建PC端的404错误页面。内容包括HTML结构和JavaScript代码实现,旨在为用户提供友好的错误提示和体验。
摘要由CSDN通过智能技术生成

html

<!DOCTYPE html>
<html lang="en" >

<head>
<meta charset="UTF-8">
<title>404 particle text</title>


<style>
/* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
body {
   
	background: #2196F3;
}

#notFound {
   
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%) scale(1.2);
  width: 80%;
  height: auto;
}

</style>


</head>

<body>


<script src='js/pixi.js'></script>
<script src="js/index.js"></script>




</body>

</html>

JS页面

//animation frame polyfill
(function () {
   
    var lastTime = 0;
    var vendors = ['ms', 'moz', 'webkit', 'o'];
    for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
   
        window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
        window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
    }

    if (!window.requestAnimationFrame)
        window.requestAnimationFrame = function (callback, element) {
   
            var currTime = new Date().getTime();
            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
            var id = window.setTimeout(function () {
   
                    callback(currTime + timeToCall);
                },
                timeToCall);
            lastTime = currTime + timeToCall;
            return id;
        };

    if (!window.cancelAnimationFrame)
        window.cancelAnimationFrame = function (id
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值