jQuery 手风琴'高度:自动'导致动画故障
我正在使用 jQuery Accordion,我希望每个部分都能够根据内部内容动态调整大小。所以我将 .ui-accordion-content-active 的样式设置为“height: auto”。当某一特定部分处于活动状态时,此功能有效;它可以正确调整大小以容纳其中的内容。
但是,当选择手风琴的不同部分时,高度属性似乎会影响动画。看起来它开始滑动,但自动高度接管,两个部分都完全打开一段时间,最后先前活动的部分关闭。
似乎应该有一种正确的方法来强制 Accordion 内容 div 动态调整大小,而不影响动画。我将不胜感激任何提示,谢谢!
I'm using a jQuery Accordion, and I want each section to be able to resize dynamically according to the inner content. So I set the styling of .ui-accordion-content-active to 'height: auto'. This works while one particular section is active; it resizes correctly to accommodate the content inside it.
However, the height property seems to affect the animation when selecting different sections of the Accordion. It looks like it starts to slide, but the auto height takes over and both sections are fully open for a brief time, and finally the previously active one closes.
It seems like there should be a correct way to force an Accordion content div to resize dynamically, without affecting the animation. I'd appreciate any tips, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在脚本标签下,编写下面给出的代码。
:)-
Under Script tag, write the code given below.
:)-
您是否检查过 jQuery UI 网站上的无自动高度演示中的标记?
它似乎完全符合你的要求。
http://jqueryui.com/demos/accordion/#no-auto-height
Have you checked out the markup from the no-auto-height demo on the jQuery UI site?
It seems to do exactly what you are asking.
http://jqueryui.com/demos/accordion/#no-auto-height