基本的jQuery slideUp 和slideDown 让我抓狂! [英] Basic jQuery slideUp and slideDown driving me mad!

查看:32
本文介绍了基本的jQuery slideUp 和slideDown 让我抓狂!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 jQuery 技能通常非常好,但这驱使我疯了!

my jQuery skills are pretty good normally but this is driving me mad!

这是我从头开始编写的相当简单的手风琴.使用jQuery 1.3.2 所以不应该有任何跳跃的错误,但基本上如果你看看例子:

It's a fairly simple accordian I've coded up from scratch. Using jQuery 1.3.2 so there shouldn't be any jumping bugs but basically if you take a look at the example:

http://www.mizudesign.com/jquery/accordian/basic.html

我在右侧显示目标 div 的高度 - 如果它包含它认为比它短并且正在跳跃的文本.如果是图片就没有问题.

I'm displaying the height for the target div on the right - if it contains text it thinks it's shorter than it is and jumping. If it's an image there's no problem.

我不知道我哪里出错了——这显然是在 CSS 中某处,但我已经尝试了所有常见的嫌疑人,例如 display:block

I can't figure out where I'm going wrong - it's obviously in the CSS somewhere but I've tried all the usual suspects like display:block

如有任何想法,我们将不胜感激!

Any ideas would be gratefully received!

你的,克里斯

PS 请原谅源代码的性质,我已经把它撕掉了我正在做的整个项目,所以它确实包括一些 div真的不需要在那里.

PS Please forgive the nature of the source code, I've ripped it out the whole project I'm working on so it does include some divs that don't really need to be there.

推荐答案

您需要为内容设置宽度或高度,才能流畅地制作动画.

You need a width or height on the content for it to animate smoothly.

这篇关于基本的jQuery slideUp 和slideDown 让我抓狂!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆