Problems with jQuery slideUp () and slideDown ()

I am inexperienced with jquery and am having problems with animations slideUp()and slideDown().

I am working on a vCard design similar to Tim Van Damme . here is the design link : link . When you press the "Portfolio" or "Job" button, the text or image appears before the sabotage ends in sliding down. I would like the div to first move down and then display the text ... This currently works when you press the contact button or the home button on the top navigation bar, but it doesn't work for the portfolio button and the work button.

I have a hunch that this might not even be a jQuery problem, and that this is just my css code code, but I looked at the css code and changed things like z-index, but that didn't work.

+3
source share
3 answers

You can use the slideDown callback function

Sort of

$("yourselector").slideDown("slow", function(){
    // your code to manipulate text and image
});
+5
source

What you need to do is that the content is always inserted into the field, even if it changes size. I tried adding overflow: hiddento a div with a class panelsin Firebug. He hid some things, but not the text on the network tab for some reason ...

+1
source

Add a short timeout if necessary.

$("yourselector").slideDown("slow", function(){
    setTimeout(function(){
        // your code to manipulate text and image
        // This will happen after _t_ milliseconds only
    }, _t_ );
});
0
source

Source: https://habr.com/ru/post/1736651/


All Articles