I'm using the following lines of code to make some text appear after a few seconds. However, I would like that to happen when my second tab is clicked. How can I manage to do so?
The JQuery:
$("#links2").click(function(){
$(document).ready(function() {
$('.animate').hide().delay(3000).fadeIn(2200);
});
}
The part of the page:
<section id="s2" class="section">
<div class="container vertical center" style="margin-top: 10px;">
<i class="fa fa-user fa-4x"></i>
</div>
<div class="container vertical center" style="">
<h2 style="font-weight: 900; font-family: arial; color: black;">
WHO AM I?
</h2>
</div>
<div class="container vertical center" style="">
<p>
<b>Hi!</b> My name is Lex.
<h3 class="animate">And I'm developer</h3>
</p>
</div>
</section>
The menu:
<div id="menu_block" name="menu_block" class="menu_block right">
<nav class="nav_block">
<a href="#s1">Home</a>
<a id="links2" href="#s2">About</a>
<a href="#s3">Projects</a>
<a href="#s4">Skills</a>
<a href="#s5">Resume</a>
<a href="#s6">Contact</a>
</nav>
</div>
I've found topics like this one. But I don't know how to use that in my situation. Also, I'm very new to javascript and JQuery, so I don't really know how to work with it. It's all a bit new to me.
However, the code I've put in my question would also not work when people would follow a direct link link this: http://localhost/JS/#s2, because the s2 link wouldn't be clicked in that situation. And I would also want it to work then.