HTML+JS+CSS 实现随机跳转到一个网址
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>即将奔赴</title>
<link rel="shortcut icon" href="链接">
<style type="text/css">
* {
color: #111827;
}
a {
text-decoration: none;
}
.blink {
position: fixed;
height: 100%;
width: 100%;
text-align: center;
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: center;
animation: blink 3s linear infinite;
-webkit-animation: blink 3s linear infinite;
-moz-animation: blink 3s linear infinite;
-ms-animation: blink 3s linear infinite;
-o-animation: blink 3s linear infinite;
}
.all_bg{
position:fixed;
top: 0;
left: 0;
width:100%;
height:100%;
min-width: 780px;
z-index:-10;
zoom: 1;
background-color: #fff;
background: url(链接);
background-repeat: no-repeat;
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
background-position: center 0;
}
@keyframes blink {
0% {
opacity: 0;
transform: scale(1);
}
20% {
opacity: 0;
transform: scale(1);
}
40% {
opacity: 0.3;
transform: scale(1);
}
80% {
opacity: 1;
transform: scale(0.98);
}
90% {
opacity: 1;
transform: scale(0.98);
}
100% {
opacity: 0.2;
transform: scale(1.2);
}
}
@-webkit-keyframes blink {
0% {
opacity: 0;
transform: scale(1);
}
20% {
opacity: 0;
transform: scale(1);
}
40% {
opacity: 0.3;
transform: scale(1);
}
80% {
opacity: 1;
transform: scale(0.98);
}
90% {
opacity: 1;
transform: scale(0.98);
}
100% {
opacity: 0.2;
transform: scale(1.2);
}
}
@-moz-keyframes blink {
0% {
opacity: 0;
transform: scale(1);
}
20% {
opacity: 0;
transform: scale(1);
}
40% {
opacity: 0.3;
transform: scale(1);
}
80% {
opacity: 1;
transform: scale(0.98);
}
90% {
opacity: 1;
transform: scale(0.98);
}
100% {
opacity: 0.2;
transform: scale(1.2);
}
}
@-ms-keyframes blink {
0% {
opacity: 0;
transform: scale(1);
}
20% {
opacity: 0;
transform: scale(1);
}
40% {
opacity: 0.3;
transform: scale(1);
}
80% {
opacity: 1;
transform: scale(0.98);
}
90% {
opacity: 1;
transform: scale(0.98);
}
100% {
opacity: 0.2;
transform: scale(1.2);
}
}
@-o-keyframes blink {
0% {
opacity: 0;
transform: scale(1);
}
20% {
opacity: 0;
transform: scale(1);
}
40% {
opacity: 0.3;
transform: scale(1);
}
80% {
opacity: 1;
transform: scale(0.98);
}
90% {
opacity: 1;
transform: scale(0.98);
}
100% {
opacity: 0.2;
transform: scale(1.2);
}
}
.botCenter {
position: fixed;
width: 100%;
height: 50px;
bottom: 2px;
line-height: 20px;
font-size: 12px;
text-align: center;
animation: botCenter 3s linear;
-webkit-animation: botCenter 3s linear;
-moz-animation: botCenter 3s linear;
-ms-animation: botCenter 3s linear;
-o-animation: botCenter 3s linear;
}
@keyframes botCenter {
0% {
opacity: 0;
}
20% {
opacity: 0;
}
40% {
opacity: 0.3;
}
80% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@-webkit-keyframes botCenter {
0% {
opacity: 0;
}
20% {
opacity: 0;
}
40% {
opacity: 0.3;
}
80% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@-moz-keyframes botCenter {
0% {
opacity: 0;
}
20% {
opacity: 0;
}
40% {
opacity: 0.3;
}
80% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@-ms-keyframes botCenter {
0% {
opacity: 0;
}
20% {
opacity: 0;
}
40% {
opacity: 0.3;
}
80% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
@-o-keyframes botCenter {
0% {
opacity: 0;
}
20% {
opacity: 0;
}
40% {
opacity: 0.3;
}
80% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 1;
}
}
</style>
</head>
<body>
<div class="blink">
<a href="链接" target="_blank"
title="点击加入“奔赴”,分享网站流量 :-)">欢迎回来,即将奔赴<br />Welcome back, coming soon...</a>
</div>
<script>
function jumpUrl(){
var arr = new Array(
"随机链接1",
"随机链接2",
"随机链接3",
"随机链接4",
"随机链接5",
);
window.location.href = arr[Math.floor(Math.random() * arr.length)];
}
setTimeout(function () {
jumpUrl();},5000);//设定跳转时间,1s=1000
</script>
<div class="all_bg"></div>
</body>
</html>
HTML+JS+CSS 实现随机跳转到一个网址的更多相关文章
- Yii2 负载均衡找不到JS,CSS
在部署项目的时候,用了2台服务器.请求的时候用了负载均衡,导致 YII2 的静态文件(js,css...)报 404 ,原因是: 请求一个页面时 A服务器 去处理,但是静态资源缺请求到了 B服务器 , ...
- Gremlins.js – 模拟用户随机操作的 JS 测试库
Gremlins.js 是基于 JavaScript 编写的 Monkey 测试库,支持 Node.js 平台和浏览器中使用.Gremlins.js 随机模拟用户操作:单击窗口中的任意位置,在表格中输 ...
- 史上前端面试最全知识点(附答案)---html & js & css
史上前端面试最全知识点(附答案) 一.html & js & css 1.AMD和CMD是什么?它们的区别有哪些? AMD和CMD是二种模块定义规范.现在都使用模块化编程,AMD,异步 ...
- 页面加载异常 清除浏览器静态文件 js css 缓存 js动态加载js css文件,可以配置文件后辍,防止浏览器缓存
js清除浏览器缓存的几种方法 - 兔老霸夏 - 博客园 https://www.cnblogs.com/Mr-Rocker/p/6031096.html js清除浏览器缓存的几种方法 一.CSS和 ...
- 使用PHP和GZip压缩网站JS/CSS文件加速网站访问速度
使用PHP和GZip压缩网站JS/CSS文件加速网站访问速度 一些泛WEB 2.0网站为了追求用户体验,可能会大量使用CSS和JS文件.这就导致在服务器带宽一定的情况下,多用户并发访问速度变慢.如何加 ...
- Vue项目零碎知识(全局js,css配置,element-UI,bs使用, img动态配置,js数组)
全局css样式,首先在静态assets中写好文件,然后要在main.js中配置 // 配置全局css样式 // import '@/assets/css/global.css' require('@/ ...
- electron之Windows下使用 html js css 开发桌面应用程序
1.atom/electron github: https://github.com/atom/electron 中文文档: https://github.com/atom/electron/tree ...
- JS打开新页面跳转
有时候使用js进行页面跳转,想使用 a 标签中 target="_blank" 形式,跳转打开一个新的页面. 可以使用以下脚本,创建一个 a标签,然后模拟点击操作. 代码如下: ...
- JS/CSS缓存杀手——VS插件
背景 前些天去考科目二,感觉经历了一场不是高考却胜似高考的考试(10年前的5分之差, 还是难以释怀)! 一行八人,就我学的时间最少(4天,8人一辆车),教练都觉得我肯定还得再来一次! 靠着运气和 ...
随机推荐
- vue-property-decorator
vue-property-decorator使我们能在vue组件中写TypeScript语法,依赖于vue-class-component 装饰器:@Component.@Prop.@PropSync ...
- 搭建SVN服务器-腾讯云
检查服务器SVN服务器 svn --version 出现版本号说明已安装 安装SVN yum install subversion 创建版本库 svnadmin create /opt/svn/rep ...
- Python教程——常用的os操作详情
Python自动的os库是和操作系统交互的库,常用的操作包括文件/目录操作,路径操作,环境变量操作和执行系统命令等. 文件/目录操作 获取当前目录(pwd): os.getcwd() 切换目录(cd) ...
- 卸载office密钥
一.管理员身份运行命令提示行: 二.命令提示行上输入: cd C:\Program Files\Microsoft Office\Office16 弹出如下内容: C:\Program Files\M ...
- 测试人员假装自己会“devops”
目录 什么是DevOps DevOps岗位职责 DevOps的要求 如何增强DevOps能力 准备 服务器端安装jenkins Jenkins jenkins + maven 构建 jenkins下m ...
- 【.NET基础】Linq常用语法代码演示
前言:前言不重要,linq入门常用的语法,linq语法可以用来写操作集合.数据库表集合等等几乎所有集合类型的操作.下面就写几个案例(以List集合来做的),看代码和运行结果即可. 本文演示环境:VS2 ...
- go grpc: connection reset by peer 的一种解决方案
最近添哥一直反映,他手下的设备以grpc stream的方式向我服务端发送数据.偶然会收到错误.现象如下: 连接已经建立了一段时间,正常使用. 突然client.Send 返回 eof. 客户端有报错 ...
- P4289 【一本通提高篇广搜的优化技巧】[HAOI2008]移动玩具
[HAOI2008]移动玩具 题目描述 在一个 4 × 4 4\times4 4×4 的方框内摆放了若干个相同的玩具,某人想将这些玩具重新摆放成为他心中理想的状态,规定移动时只能将玩具向上下左右四个方 ...
- 多校B层冲刺NOIP20211111模拟12
题面:PDFhttp://xn--gwt928b.accoders.com/pdf/10248/10248.pdfhttp://xn--gwt928b.accoders.com/pdf/10248/1 ...
- uniapp调用jar
前言 此方法为使用uniapp开发前端资源,然后继承进安卓原生项目,达到调用uniapp调用jar的效果. 基于Android Studio进行开发. 本人不懂安卓以及gradle,只是基于搜索引擎以 ...