Skip to content
Permalink
Browse files

accordion: Fixed #3682, setting overflow:auto for fillSpace:true acco…

…rdions; added demo
  • Loading branch information
jzaefferer committed Dec 26, 2008
1 parent d162087 commit 7a5803057952f6fdbc2f423d1fadc36b448df057
Showing with 49 additions and 3 deletions.
  1. +44 −0 demos/accordion/fillspace.html
  2. +1 −0 demos/accordion/index.html
  3. +4 −3 ui/ui.accordion.js
@@ -0,0 +1,44 @@
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Accordion - FillSpace Demo</title>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.2.6.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-mouseover").accordion({
event: "mouseover",
header: "h3",
fillSpace: true
});
})
</script>
</head>
<body>

<div id="accordion-mouseover" style="width: 200px; height: 250px">
<div>
<h3><a href="#">Nullam blandit</a></h3>
<div>
Duis pretium. Nullam venenatis. Donec ornare. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet magna ac lorem elementum euismod. Nulla eu leo. Phasellus purus arcu, semper sed, scelerisque eget, molestie vitae, ante. Nam et purus. Vivamus nec lacus. Mauris pulvinar vehicula orci. Nunc quam metus, iaculis ut, viverra at, tempor vel, arcu. Aliquam dictum massa non diam. Pellentesque vel odio. Integer volutpat placerat velit. Phasellus rhoncus, diam ac fermentum suscipit, velit est eleifend dolor, et cursus massa pede et diam. Cras eu tortor. Quisque vitae ante nec erat venenatis luctus. Donec commodo suscipit nulla. Nunc nec ligula id nulla dictum dictum.
</div>
</div>
<div>
<h3><a href="#">Aliquam nulla</a></h3>
<div>
Ut varius. Cras gravida, ante vel porttitor porttitor, sapien magna eleifend dolor, sit amet eleifend justo neque sit amet neque. Donec a nisl sed orci pharetra sodales. Proin ullamcorper, mi sit amet tempor blandit, dolor diam vestibulum nibh, eu sollicitudin lorem risus quis tellus. Ut scelerisque consequat ipsum. Vivamus tellus velit, faucibus eu, venenatis sit amet, varius eu, turpis. In molestie nisi id purus. Pellentesque et dolor. Proin metus nisl, sollicitudin at, aliquet eu, porta eget, est. Donec ut libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
</div>
</div>
<div>
<h3><a href="#">Proin tincidunt</a></h3>
<div>
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Ut quam massa, scelerisque sit amet, lacinia sit amet, facilisis ullamcorper, nunc. Nulla vehicula auctor felis. Nullam lobortis erat quis metus. Maecenas molestie, quam lobortis tincidunt ultricies, dolor ante rutrum nisl, in vestibulum nisi odio consectetur enim. Nam tellus felis, ultrices nec, elementum malesuada, congue quis, lacus. Aliquam hendrerit interdum eros. Etiam egestas iaculis urna. Cras venenatis pharetra nunc. Etiam scelerisque mauris eget massa. Nam nec lectus eu purus tempus feugiat. Nunc quam. In facilisis venenatis nisl. Nullam id sapien. Nullam lacinia quam facilisis sem. Nullam facilisis convallis justo. Praesent dictum facilisis purus. Integer cursus ligula at nibh. Mauris in felis id nisl porttitor auctor. Quisque erat.
</div>
</div>
</div>

</body>
</html>
@@ -16,6 +16,7 @@
<dt>Accordion</dt>
<dd><a href="default.html">Default</a></dd>
<dd><a href="mouseover.html">Mouseover</a></dd>
<dd><a href="fillspace.html">FillSpace</a></dd>
</dl>

</body>
@@ -141,7 +141,8 @@ $.widget("ui.accordion", {
var maxPadding = 0;
options.headers.next().each(function() {
maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
}).height(maxHeight - maxPadding);
}).height(maxHeight - maxPadding)
.css('overflow', 'auto');
} else if ( options.autoHeight ) {
maxHeight = 0;
options.headers.next().each(function() {
@@ -207,15 +208,15 @@ function toggle(toShow, toHide, data, clickedActive, down) {
toHide: toHide,
complete: complete,
down: down,
autoHeight: options.autoHeight
autoHeight: options.autoHeight || options.fillSpace
};
} else {
animOptions = {
toShow: toShow,
toHide: toHide,
complete: complete,
down: down,
autoHeight: options.autoHeight
autoHeight: options.autoHeight || options.fillSpace
};
}

0 comments on commit 7a58030

Please sign in to comment.
You can’t perform that action at this time.