accordion: fix for #4436

This commit is contained in:
Jörn Zaefferer 2009-08-11 18:46:00 +00:00
parent 5c5e0832d4
commit e132c1b363
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,50 @@
<!doctype html>
<html lang="en">
<head>
<title>Accordion Visual Test : Accordion option autoHeight true</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/ui.core.js"></script>
<script type="text/javascript" src="../../../ui/ui.accordion.js"></script>
<script type="text/javascript">
$(function() {
$("#accordion").accordion({
fillSpace: true
});
})
</script>
</head>
<body>
<div style="height: 500px; width: 500px; border: 1px solid red;">
<div id="accordion" style="width:490px;">
<h3><a href="#">Accordion Header 1</a></h3>
<div>
Accordion Content 1
</div>
<h3><a href="#">Accordion Header 2</a></h3>
<div>
Accordion Content 2
<p>paragraph</p>
<p>paragraph</p>
<p>paragraph</p>
<p>paragraph</p>
<p>paragraph</p>
<p>paragraph</p>
<p>paragraph</p>
</div>
<h3><a href="#">Accordion Header 3</a></h3>
<div>
Accordion Content 3
<ul>
<li>list item</li>
<li>list item</li>
<li>list item</li>
</ul>
</div>
</div>
</div>
</body>
</html>

View File

@ -213,7 +213,7 @@ $.widget("ui.accordion", {
if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
this.headers.each(function() {
maxHeight -= $(this).outerHeight();
maxHeight -= $(this).outerHeight(true);
});
var maxPadding = 0;