css preloader.css
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css preloader.css相关的知识,希望对你有一定的参考价值。
(function() {
var overlayBox = document.createElement('div');
overlayBox.id = 'overlay';
var spinnerHolder = document.createElement('div');
spinnerHolder.className = 'multi';
var spiner = document.createElement('div');
document.body.appendChild(overlayBox);
overlay.appendChild(spinnerHolder);
spinnerHolder.appendChild(spiner);
window.addEventListener('load', function(){
spinnerHolder.removeChild(spiner);
overlay.removeChild(spinnerHolder);
overlay.parentNode.removeChild(overlay);
});
})();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="preloader.css">
</head>
</body>
<script src="preloader.js"></script>
</html>
body {
margin: 0;
}
html {
height: 100%;
}
#overlay {
background: rgba(2,13,16,0.9);
width: 100%;
height: 100vh;
position: relative;
z-index: 5000;
}
/*******************************************
TECH SPINNER
http://codepen.io/joeyhoer/pen/aoiJt
********************************************/
.multi {
/* position */
position: absolute;
top: 50%;
left: 50%;
margin-left: -50px;
margin-top: -50px;
/* core */
height: 50px;
width: 50px;
border-width: 5px;
border-style: solid;
border-color: transparent rgba(255, 255, 255, 0.25) transparent rgba(255, 255, 255, 0.5);
border-radius: 100%;
animation: clockwise 1.01s linear infinite;
z-index: 5000;
}
.multi:after {
position: absolute;
display: block;
top: 5px;
right: 5px;
height: 30px;
width: 30px;
border-width: 5px;
border-style: solid;
border-color: rgba(255, 255, 255, 0.5) transparent transparent;
border-radius: 100%;
z-index: 5000;
}
.multi div {
position: relative;
height: 40px;
width: 40px;
border-width: 5px;
border-style: solid;
border-color: rgba(255, 255, 255, 0.25) transparent rgba(255, 255, 255, 0.5);
border-radius: 100%;
z-index: 5000;
animation: counter-clockwise 0.49s linear infinite;
}
.multi div:after {
position: absolute;
display: block;
top: 0;
right: 0;
height: 30px;
width: 30px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent rgba(255, 255, 255, 0.25);
border-radius: 100%;
z-index: 5000;
}
@keyframes clockwise {
to {
transform: rotate(360deg) translatez(0);
}
}
@keyframes counter-clockwise {
to {
transform: rotate(-360deg) translatez(0);
}
}
以上是关于css preloader.css的主要内容,如果未能解决你的问题,请参考以下文章
jquery:厌倦了 css().css().css()
如何在CSS中调用公用css
css [css:fadeout / fadein] css示例。 #css
css基础 CSS 组合选择符CSS 伪类CSS 伪元素
css 深度提示#css中的css base builder CSS
css基础 CSS 媒体类型CSS 属性 选择器CSS 表单CSS 计数器