我有jQuery动画问题...
I am having jQuery animation issues...
我有一个页脚,在它的顶部有一个隐藏的div。 当有人单击标题附近的按钮时,div应该动画。类似向上滑动,就像您在抽屉中拉出马尼拉文件夹。 (不是正常的向上滑动,其底部的div滑动到顶部。)
I have a footer with a hidden div on top of it. When someone clicks a button near the header, the div should animate UP. Sort of like sliding up, like you're pulling a manila folder out of a drawer. (Not the normal slide up where the bottom of the div slides up to the top.)
我发现这段代码是什么我想要的,它正在移动基线(页脚)。
I found this piece of code that is kind of what I want, however, it's moving the baseline (footer).
.featureBox{width:182px; height:150px; position:relative; border:1px solid red; } $('.featureBox').hover(function() { $(this).animate({top:'-320px', height:'540px'},"slow"); }, function() { $(this).animate({top:'0px', height:'150px'},"slow"); })当鼠标悬停在红色div框上时,它下面的div下推。如何让它只是动画或长大?
When mousing over the red div box, you'll see that the div below it pushes down. How do I get it to just animate up or grow up? (He-he. Sorry. Just thought of mom yelling at me).
推荐答案这里是一个页面工作的方式,我想你想要的。我认为主要的问题是扩展的div需要在一个具有高度的div。 这里是展开时覆盖其他内容的页面。
Here is a page working the way I think you want. I think the main problem was the the expanding div needs to be inside a div that has a height. Here is a page with the expaning div covering other content when it expands.
请查看 Wordpress Sexybookmarks插件的代码,以获取这种伎俩的好例子。
Check out the code for the Wordpress Sexybookmarks plugin for a good example of this kind of trick.
更多推荐
jQuery:动画难题
发布评论