jQueryを使って、最初の画面で全画面にロゴがフェードダウンするものを作りたいのですが、(参考にしたサイト)最初から表示されており、フェードインしません。
※フェードアウトはできています。
jQuery
1<!DOCTYPE html> 2<html lang="en"> 3<head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 7 <title>Document</title> 8</head> 9<body> 10 <div class="start"><p><img src="slice_13.png" alt="ロゴ画像" class="img_logo"></p></div> 11 12 13<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> 14<script> 15 $(function() { 16 setTimeout(function(){ 17 $('.start p').fadeIn(1600); 18 },500); //0.5秒後にロゴをフェードイン! 19 setTimeout(function(){ 20 $('.start').fadeOut(500); 21 },2500); //2.5秒後にロゴ含め真っ白背景をフェードアウト! 22}); 23</script> 24 <style type="css"> 25 .start { 26 background: #FFF; 27 position: fixed; 28 top: 0; 29 left: 0; 30 height: 100%; 31 width: 100%; 32 z-index: 9000; 33 } 34 35 .start p { 36 position: fixed; 37 left: 50%; 38 top: 50%; 39 transform: translate(-50%, -50%); 40 display: none; 41 z-index: 9999; 42 width: 280px; 43 } 44 </style> 45</body> 46</html>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/09/02 12:28