How do I click on a zone to display a div from the center with jQuery?

0

Good morning. I have this code to display the div after clicking on the photo of Stolen Kiss, attached photo:



When I click on the photo I want this div to start from the center and expand up and down at the same speed.

Deputy photo of the div:

The problem is that I have not found any command or form to make it appear as I want, I tried the fadeIn but it's not what I'm looking for.
I do not put my code since it works as I want, what I want to know is if there is any jQuery function that works for what I ask since I have not found anything useful.

Greetings.

    
asked by Mikel Molinuevo 15.11.2017 в 09:44
source

1 answer

1

After looking at several different methods, a friend told me that the animate () method is used. The code is finally like this:

            $("#wander").click(function(){                  
                $("#float").show();
                $("#float").animate({height:500},500);
                $("#div_negro").show();
            });

The height attribute has to be defined in CSS from what size you want it to start. In the animate method the height is the height at which the div float will arrive and the 500 on the left is the milliseconds that it will take to do so.

    
answered by 15.11.2017 / 10:45
source