避免自动更改 jQuery 手风琴的宽度
如果我访问 Accordion 的内容,如何避免 jQuery Accordion 标头自动调整大小?
脚本:
<script type="text/javascript" >
$(document).ready(function() {
$("#dvAccordion").accordion(
{ autoHeight: false,
collapsible: true
}
);
});
</script>
标记:
<div id="dvAccordion">
<h5><a href="#fragment1"><asp:Label runat="server" ID="lblAccordionRC" Text="Hi" meta:resourcekey="lblAccordionRC" ></asp:Label></a></h5>
<div id="fragment1">
<div style=" height:10px; width:200%; background-color:Blue;"></div>
</div>
<h5><a href="#fragment2"><asp:Label runat="server" ID="lblAccodionUNC" Text="How" meta:resourcekey="lblAccodionUNC"></asp:Label></a></h5>
<div id="fragment2">
How are You ?
</div>
</div>
第一个手风琴包含比第二个更宽的 div。如果我单击第一个手风琴,则会调整手风琴标题的大小。然后,如果我单击第二个手风琴,它会缩小。它使最终用户的页面可视化效果很差。 如何删除此自动调整大小?
How can I avoid auto-resizing of jQuery Accordion headers if I visit content of accordion ?
Script:
<script type="text/javascript" >
$(document).ready(function() {
$("#dvAccordion").accordion(
{ autoHeight: false,
collapsible: true
}
);
});
</script>
Markup:
<div id="dvAccordion">
<h5><a href="#fragment1"><asp:Label runat="server" ID="lblAccordionRC" Text="Hi" meta:resourcekey="lblAccordionRC" ></asp:Label></a></h5>
<div id="fragment1">
<div style=" height:10px; width:200%; background-color:Blue;"></div>
</div>
<h5><a href="#fragment2"><asp:Label runat="server" ID="lblAccodionUNC" Text="How" meta:resourcekey="lblAccodionUNC"></asp:Label></a></h5>
<div id="fragment2">
How are You ?
</div>
</div>
The first accordion contains a wider div than second. If I click on first accordion, a resize of header of accordions takes place. Then If I click second accordion, it shrinks back. It makes a bad visualization of page in end user. How can I remove this auto-resize ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于某种原因,使用 css 设置手风琴的宽度
,在 html 中设置宽度似乎无法与 jquery 正常工作。
set the width of the accordion using css
for some reason, setting width in html doesn't seem to work properly with the jquery.