The last feature we'd like to add is an aesthetic one. Right now when we click the 'Recent Projects' buttons, the projects appear instantly.
Let's instead make the projects slide onto the page when we click the 'Recent Projects' button and then slide off the page when we click the button again.
jQuery provides a method named
slideToggle that can animate an element's entrance and exit. The syntax looks like this:
slideToggle can be called directly on a jQuery selector.
slideToggle also takes a parameter of milliseconds that the animation should last. The default is 400 milliseconds, or 0.4 seconds.