开发者

jquery slideUp() and slideDown() problems

I am inexperienced with jquery, and I'm having some trouble with the slideUp() and slideDown() animations.

I have been working on a vCard design similar to Tim Van Damme's site. here is the link to the design: link. When you click on the portfolio or work button, the te开发者_如何学Pythonxt or image appears first before the div finishes sliding down. I would like the div to slide down first and then show the text... This currently works when you click on the contact button or the home button on the top navigation bar, but does not work for the portfolio button and the work button.

I have a hunch that this may not even be a jQuery problem, and that its just my bad css code, but I have skimmed through the css code, and changed things like z-index, but that hasnt worked.


You can use the callback function of slideDown

Something like

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


What you need to do is make the content fit into the box at all times, even as it is changing size. I tried adding overflow: hidden to the div with class panels in Firebug. It hid some of the stuff, but not the text on the network tab for some reason...


Add a small timeout too if needed.

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜