jQuery:动画难题

编程入门 行业动态 更新时间:2024-10-05 19:09:26
本文介绍了jQuery:动画难题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有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:动画难题

本文发布于:2023-11-29 15:16:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646769.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:难题   动画   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!