0
私は背景としてparticle.jsを使用してヘッダーを作成しようとしていますが、ページの上部にある会社ロゴの下にパーティクルが表示されません。私は上部にある粒子を得ることができましたが、それはどちらかです:パーティクルをインタラクティブに保ちながら、particles.jsをヘッダの背景として設定するにはどうしたらいいですか?
a。ヘッダーの代わりにページ全体をカバーするか、または
b。ロゴの上にあってクリック不可能にしてください。
c。インタラクティブではない粒子を作るロゴの下にある。
まだインタラクティブになっている間に、ロゴの後ろのページの上部にパーティクルを手に入れることができますか?
HTML::
<html lang="en">
<head>
<meta charset="utf-8">
<title>Company</title>
<meta name="description" content="Tech">
<meta name="author" content="Jansenzoon">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" media="screen" href="css/style.css">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<link href="css/responsive-style.css" rel="stylesheet">
<link href="css/weather-icons.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="css/lightbox.min.css" rel="stylesheet">
<link href="css/loaders.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- particles.js container -->
<div id="particles-js">
<div class="container">
<div class="row">
<div class="col-sm-6" align="left">
<a href="index.html" class="nav-link"><img class="img-fluid img-rounded" src="https://logomarts.files.wordpress.com/2015/07/logo-example2.jpg" width="200"></a>
</div>
<div class="col-sm-6" align="right">
<nav class="nav nav-inline">
<a target="_blank" href="https://www.facebook.com" class=" fa fa-facebook"></a>
<a target="_blank" href="https://www.twitter.com" class=" fa fa-twitter"></a>
<a target="_blank" href="https://plus.google.com" class=" fa fa-google-plus"></a>
<a target="_blank" href="https://www.linkedin.com" class=" fa fa-linkedin"></a>
<a target="_blank" href="https://www.youtube.com" class=" fa fa-youtube"></a>
</nav>
</div>
</div>
</div>
</div>
<!-- scripts -->
<script src="../particles.js"></script>
<script src="js/app.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/core.js"></script>
<script src="js/lightbox-plus-jquery.min.js"></script>
</body>
</html>
CSS:
/* ---- reset ---- */
html,body{
width:100%;
height:100%;
margin: 0;
}
canvas {
display: block;
vertical-align: bottom;
background: #ff0000;
}
/* ---- particles.js container ---- */
#particles-js{
width: 100%;
height: 15%;
position: fixed;
z-index: 0;
top: 0;
left: 0
background: #000000;
background-image: url('');
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
}
.container {
max-width: 960px;
width: 90%;
margin: 0 auto;
}
.content {
-webkit-box-sizing: border-box;
-mozbox-sizing: border-box;
box-sizing: border-box;
background-color: rgba(255,255,255, 0.75);
padding: 0.1em 1em;
font-family: 'Lato', sans-serif;
}
JS:
particlesJS('particles-js',
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#0070bb"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#0070bb"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {
"enable": false,
"speed": 1,
"opacity_min": 0.1,
"sync": false
}
},
"size": {
"value": 3,
"random": true,
"anim": {
"enable": false,
"speed": 40,
"size_min": 0.1,
"sync": false
}
},
"line_linked": {
"enable": true,
"distance": 150,
"color": "#0070bb",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 1200
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "repulse"
},
"onclick": {
"enable": true,
"mode": "push"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 400,
"size": 40,
"duration": 2,
"opacity": 8,
"speed": 3
},
"repulse": {
"distance": 200,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}
);
これは私がこれまで使ってきたコードです
私はあらかじめヘルパーに感謝したいと思います。
コードを入力できますか? – Jdruwe