使用 jQuery SlideToggle 扩展 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的
您需要删除该
position:absolute;
,然后它将按预期工作,目前它在正常流程中不占用任何空间,这意味着它所在的不会扩展以容纳它。只需删除此样式即可解决问题:)
You have this style going on with that
<form class="fcfSamplePack">
: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 :)我在 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.