javascript - Preloader fade out and content fade in -


i'm sure easy fix. need preloader fade out slowly. tried css animation didn't work. can tell me how should in javascript ? can see in example, transition rough. don't want that.

<script> <!--preloader--> var myvar;  function preloader() {     myvar = settimeout(showpage, 1500); }  function showpage() {   document.getelementbyid("preloader").style.display = "none";   document.getelementbyid("wrapper").style.display = "block"; } </script> 

codepen example

add following changes codes.

#preloader {   transition:1s ease; }  #wrapper {   opacity:0;/*remove display , hide opacity*/  }  function showpage() {   document.getelementbyid("preloader").style.opacity = 0;   document.getelementbyid("wrapper").style.opacity = 1; } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -