ローディング画面でローディング完了後、その要素を削除したいのですがうまくいきません。
どなたかご教授ください。
javascript
1window.addEventListener('load', function() { 2 3 var loadingAnim = document.getElementById('#loadingAnim'), 4 body = document.body; 5 6 setTimeout( function(){ 7 8 body.classList.add('loaded'); 9 10 // ここから 11 loadingAnim.querySelectorAll('.loadingAnim_line').addEventListener('transitionend', function( e ){ 12 (this).parentNode.removeChild(this); 13 }); 14 // ここまでの部分 15 }, 1000 ); 16});
HTML
1<body> 2 <!-- ここの部分を削除したい --> 3 <div id="loadingAnim" class="loadingAnim"><i class="loadingAnim_line"></i></div> 4 <!-- ここの部分を削除したい --> 5 6 <header class="index"> 7 <h1 class="index_wow">Wow!</h1> 8 <span class="index_description">that was surprised.</span> 9 </header> 10 <p class="linkto"><a href="http://satohmsys.info">Go to developer's blog</a></p> 11</body>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。