I have a single div that initially displays text, and I want it to fade out after a specific time so that another div will then fade in. However, my attempt at coding this transition is not producing the desired result:
$(function() {
$(".preload").fadeOut(20, function() {
$(".content").fadeIn(20);
});
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="preload">
<h1>1st page</h1>
</div>
<div class="content">
<h1>2nd page </h1>
</div>