Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Hi, why my div doesn't slide up or down with JQuery methods?

Hi, after fading in my div container I want it to slide up, but it doesn't work, it just disappears, can you tell me what's wrong with it? Here is my code: The HTML:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Quiz App</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/basic.css">
  </head>
  <body>
    <div class="container">

    </div>


    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
    <script src="app.js"></script>
  </body>
</html>

The CSS:

body {
  min-height: 100vh;
  background: linear-gradient(to right, rgba(210, 27, 192), rgba(74, 66, 224));
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  min-height: 40vh;
  width: 50%;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  display: none;
}

The JavaScript:

$(".container").fadeIn(2000).slideUp(2000);