使用 jQuery SlideToggle 扩展 Div

发布于 2024-09-08 10:25:03 字数 269 浏览 7 评论 0原文

任何人都可以为我阐明这一点:

http://67.212.188.229/fcf/index.html< /a> <- 请查看右侧面板,我希望用户单击其中一个面板并让框随其内容展开。我有点击和内容,但出于某种原因我无法让 div 随内容扩展。

任何帮助都会受到极大的欢迎。

问候,

毫米

Can anyone shed some light on this for me:

http://67.212.188.229/fcf/index.html <- Please look at the right hand side panels, I would like the user to click on either and have the box expand with its content. I have the click and the content but for the whatever reason I cannot get the div's to expand with the content.

Any help is greatly received.

Regards,

mm

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

客…行舟 2024-09-15 10:25:03

您的

具有这种风格:

.fcfSamplePack {
    position: absolute;
    width: 247px;
    margin: 10px;
    display:none;
    margin-top: 10px;
}

您需要删除该 position:absolute;,然后它将按预期工作,目前它在正常流程中不占用任何空间,这意味着它所在的

不会扩展以容纳它。只需删除此样式即可解决问题:)

You have this style going on with that <form class="fcfSamplePack">:

.fcfSamplePack {
    position: absolute;
    width: 247px;
    margin: 10px;
    display:none;
    margin-top: 10px;
}

You need to remove that position: absolute;, then it'll work as expected, currently it doesn't occupy any space in the normal flow, meaning that the <div> it's in won't expand to accommodate it. Just removing this style will correct the issue :)

假扮的天使 2024-09-15 10:25:03

我在 chrome 中看到的是,您的 div 正在工作,但文本框比 div 宽。而且 div 没有背景颜色,所以我可以看到它下面的内容。我尝试使用以下 div 样式,它看起来更好一点 background-color:white;边框:1px 红色实心;内边距:10px;。文本框变宽的原因是应用在其上的样式具有 2px 的填充,除了 100% 的宽度之外,还增加了 4px 的宽度。此外,应用于输入的任何边框都会添加到宽度中。这样文本框就会变得更宽。因此,另一个选择是将文本框的宽度设置为 90%。

我还注意到,当我单击输入时,div 会隐藏。此外,当我单击第二个按钮一次并单击第一个按钮时,两个 div 都是可见的。

What I saw in chrome was that your div was working, but the text boxes were wider than the div. Also the div didn't have a background color so I could see the content below it. I tries putting the following style of the div an it looked a little bit better background-color: white; border: 1px red solid; padding: 10px;. The reason for text boxes becoming wider is that the style applied on them has a padding 2px that increases they width with 4px in addition to the width of 100%. Also any border applied to the inputs is added in the width. In this way the text boxes become wider. So another option for you is to set the width of the text boxes to be 90%.

I also noticed that when I click in an input the div hides. Also when I click on the second button once and the on the first button, both divs are visible.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文