I am new to JS.
Right now I managed to make a text appear and a div slide to the right when I click on a div.
The problem is: How can I manage to do this in reverse? (with the same animation)
I tried the if/else statement but I cant get it done. Hope some of you can help me.
Here is my Javascript code
$(document).ready(function(){
$('#profile').click(function() {
$('#profile-info').fadeIn("").addClass('animated fadeInDown');
$('#profile').animate({left:'200px'}, 800,'swing');
});
});
Here is my HTML code
<section>
<div id="profile">
</div>
<div id="profile-photo">
</div>
<div id="profile-info">
<p>Hello, I'm</p>
<p>Rick James</p>
</div>
</section>