You can try using fadeIn, try the following code: so add the hide class to the html tags as shown below:
<button>Toggle class</button>
<h1 class="hide">My First Line</h1>
<h2 class="hide">The Second Line</h2>
<p class="hide">This is a paragraph.</p>
<span class="hide">This is a span.</span>
Also you need to determine what in css:
.blue {
color: blue;
}
.yellow {
color: yellow;
}
.red {
color: red;
}
.gray{
color: gray;
}
.hide{
display:none;
}
And how do you use it in a script:
$(document).ready(function(){
$("button").click(function(){
$("h1").fadeIn(4000).toggleClass("blue");
$("h2").fadeIn(4000).toggleClass("yellow");
$("p").fadeIn(4000).toggleClass("red");
$("span").fadeIn(4000).toggleClass("gray");
});
});
4000 = 4 , .
, .