Wikipedia project - Slide down div results after they have been generated

Wikipedia project - Slide down div results after they have been generated
0.0 0

#1

Right now my results div just pops up when the search was successful. I’m trying to make it so that it slides down after the dynamic content in that div has been generated. I’m using $('#searchResults').slideDown('slow'); but this isn’t working because if I put it at the top of my code it would slide an empty div down. If I put it at the bottom the content has already been generated and has popped up on screen. How could I solve this?


#2

Hi there. While using methods like fadeIn() or slideIn(), you first need to set the display property of that element as

display: none;

Else, I do not think it’ll work right. Try changing that and see if it’s any better.


#3

This is definitely on the right track, but I’m still having some issues. I’ve created a new css class for the search results with display:none; and have also created jquery to remove this class after my code has run (& the div contents generated). $("#searchResults").removeClass("searchDisplay")

So far so good. But next what happens is my search results appear without the desired animation squished into only the first column, not looking so good. How could I correct this?


#4

That seems to be because of a wrong bootstrap grid class. Line number 25 in your HTML code. Meant to be an offset class eh…?


#5

good catch, thank you so much. That’s cleared up everything!