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

Konrad Pilch
Konrad Pilch
2,435 Points

How do add slideDown(); ?

Hello,

I want to add here slideDown and slideUp.

Codepen

How can i do it?

1 Answer

Steven Parker
Steven Parker
229,967 Points

I couldn't tell from looking at your pen just what you want to slide, or what event you would like to trigger it. A generic example might look like this:

$( "#something_clickable" ).click(function() {
    $( "#thing_to_slide" ).slideDown("slow");    // or maybe slideToggle()
});

Konrad, your questions are often fun because you're so curious and you explore the neatest things, but you'd accomplish a lot more if you acquire some basic research skills. The JQuery API documentation online is really great, and there are many examples of using it in the courses here.

slideDown() works similarly to fadeIn() and show() and all are very easy to use. Spend a little time working with the online docs and you'll be able to do these things on your own.

Konrad Pilch
Konrad Pilch
2,435 Points

I checked it, I didn't manage to do it the proper way, so i posted on treehouse.

I want the navbar to slide down when cloned , and slide up when removed. And im just curious if thats a way to do it, or somehting. E.g to fade in or out, the element needs to be hidden first, which means id need to write hiden and then fade out or in.